The strategy submits a EnterLongStopMarket order @ High + Ticksize, to buy immediately after a green candle. It then uses even OnExecutionUpdate to submit ExitLongStopMarket stoploss 4 ticks below execution.Order.AverageFillPrice
The error occurs when Strategy Analyzer uses Order Fill Resolution = High, Type = Minute, Value = 1.
The strategy prints to the output window every order action:
01-03-2016 19:30:00 ***Buy Stop Entry Order Submitted at Price=17387
01-03-2016 19:30:00 ***Buy Stop Entry Order Filled at 17387 Close[0]=17386 SL=17383 PT=17395
01-03-2016 19:30:00 ***SL Order Filled at 17383
01-03-2016 20:00:00 ***Buy Stop Entry Order Submitted at Price=17390
01-03-2016 20:00:00 ***Buy Stop Entry Order Filled at 17390 Close[0]=17386 SL=17386 PT=17398
Strategy 'UsrSTOPOdrFails/-1': A Sell stop order placed at '1/3/2016 8:00:00 PM' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.
The second Market order was filled at 17390 as NT refuses to submit stoploss of 17386 because the price is equal to or less than the previous close, aka Close[0].
This error does NOT violate the NT “Internal Order Handling Rules”, because the Stoploss order is an “Exit Order” of an existing position that is submitted dynamically on event OnExecutionUpdate and not on event OnBarUpdate
Can you please reproduce this using the strategy I`ve uploaded and let me know ?
Comment