From 17f548391cc442235429793890d227390b50432b Mon Sep 17 00:00:00 2001 From: Romazes Date: Thu, 11 Jul 2024 18:26:20 +0300 Subject: [PATCH] refactor:test: increase increment/decrement price --- .../TradeStationBrokerageTests.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/QuantConnect.TradeStationBrokerage.Tests/TradeStationBrokerageTests.cs b/QuantConnect.TradeStationBrokerage.Tests/TradeStationBrokerageTests.cs index fbb37041..8f6c3812 100644 --- a/QuantConnect.TradeStationBrokerage.Tests/TradeStationBrokerageTests.cs +++ b/QuantConnect.TradeStationBrokerage.Tests/TradeStationBrokerageTests.cs @@ -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 OrderTestParameters @@ -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") }; } @@ -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") }; }