I am getting an error while submitting a stop loss order for which I cannot find an explanation.
I have isolated the problem in a concrete example scenario. You can easily test it and get the same results from the Strategy Analyzer, ES 06-20, 15-min bars, from January 01, 2020 to January 09, 2020, so that the numbering of the bars corresponds.
1.- On January 8, 2020 at 3:00 PM in bar # 332 I send a buy Stop-Limit order to enter long, at the stop price of 3242.50. The log reports ok.
2.- When I receive the filling of the entry order, within the OnExecutionUpdate, I send an exit bracket where the stop-loss order has a stop price = 3235.00.
The log reports that the stop loss order has been ignored because its stop price (3235.00) is above the market.
I understand that the closing price taken into account is that of bar # 342, which is well above the stop loss. So how is it possible that the stop loss order is ignored?
3.- What is surprising (unless I am conceptually wrong), is that if the OrderType of the ENTRY order is StopMarket instead of StopLimit, the stop-loss order (it is a EXIT order) works fine. I don't understand how it can influence if the entry order is already filled.
I attach the code.
Thanks.

Comment