Skip to content

Commit

Permalink
refactor:test: increase increment/decrement price
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Jul 11, 2024
1 parent a4f37e1 commit 17f5483
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ protected override decimal GetAskPrice(Symbol symbol)
var lastPrice = _brokerage.GetPrice(symbol).Last;
if (IsLongOrder)
{
return AddAndRound(lastPrice, 0.01m);
return AddAndRound(lastPrice, 0.03m);
}
return SubtractAndRound(lastPrice, 0.01m);
return SubtractAndRound(lastPrice, 0.03m);
}

private static IEnumerable<TestCaseData> OrderTestParameters
Expand Down Expand Up @@ -398,9 +398,9 @@ private OrderTestParameters GetLastPriceForShortOrder(Symbol symbol, OrderType o
var lastPrice = _brokerage.GetPrice(symbol).Last;
return orderType switch
{
OrderType.Limit => new LimitOrderTestParameters(symbol, AddAndRound(lastPrice, 0.3m), SubtractAndRound(lastPrice, 0.3m)),
OrderType.StopMarket => new StopMarketOrderTestParameters(symbol, SubtractAndRound(lastPrice, 0.3m), SubtractAndRound(lastPrice, 0.6m)),
OrderType.StopLimit => new StopLimitOrderTestParameters(symbol, SubtractAndRound(lastPrice, 0.3m), SubtractAndRound(lastPrice, 0.3m)),
OrderType.Limit => new LimitOrderTestParameters(symbol, AddAndRound(lastPrice, 0.03m), SubtractAndRound(lastPrice, 0.03m)),
OrderType.StopMarket => new StopMarketOrderTestParameters(symbol, SubtractAndRound(lastPrice, 0.03m), SubtractAndRound(lastPrice, 0.06m)),
OrderType.StopLimit => new StopLimitOrderTestParameters(symbol, SubtractAndRound(lastPrice, 0.03m), SubtractAndRound(lastPrice, 0.03m)),
_ => throw new NotImplementedException("Not supported type of order")
};
}
Expand All @@ -417,9 +417,9 @@ private OrderTestParameters GetLastPriceForLongOrder(Symbol symbol, OrderType or
var lastPrice = _brokerage.GetPrice(symbol).Last;
return orderType switch
{
OrderType.Limit => new LimitOrderTestParameters(symbol, AddAndRound(lastPrice, 0.2m), SubtractAndRound(lastPrice, 0.2m)),
OrderType.StopMarket => new StopMarketOrderTestParameters(symbol, AddAndRound(lastPrice, 0.4m), AddAndRound(lastPrice, 0.6m)),
OrderType.StopLimit => new StopLimitOrderTestParameters(symbol, AddAndRound(lastPrice, 0.4m), AddAndRound(lastPrice, 0.6m)),
OrderType.Limit => new LimitOrderTestParameters(symbol, AddAndRound(lastPrice, 0.02m), SubtractAndRound(lastPrice, 0.02m)),
OrderType.StopMarket => new StopMarketOrderTestParameters(symbol, AddAndRound(lastPrice, 0.04m), AddAndRound(lastPrice, 0.06m)),
OrderType.StopLimit => new StopLimitOrderTestParameters(symbol, AddAndRound(lastPrice, 0.04m), AddAndRound(lastPrice, 0.06m)),
_ => throw new NotImplementedException("Not supported type of order")
};
}
Expand Down

0 comments on commit 17f5483

Please sign in to comment.