I'm working on a strategy that gives me the "UnableToSubmitOrder" error for an order of type "ExitShortStopMarket" or "ExitLongStopMarket."
- The strategy enters with orders like "EnterLong("Long1")" or "EnterShort("Short1")."
- In the "OnOrderUpdate" method, the order is saved in a variable.
- In the "OnExecutionUpdate" method, the ProfitTarget and Stop Loss are set using the "ExitShortStopMarket" and "ExitLongStopMarket" orders.
- Upon entering a trade, the following orders have the following states:
* Long1: Filled
* Target1: Working
* Stop1: Accepted
So, I have a long position with its corresponding Profit Target and Stop Loss correctly set, which can also be seen on the chart.
- At a certain point, the price moves very quickly against me, and I get the "UnableToSubmitOrder" error for Stop1, and the state of Stop1 is rejected.
- The "RealtimeErrorHandling" setting is set to "IgnoreAllErrors" to capture errors.
1. When the Stop1 order is rejected, what happens to this order? Does it stay in the rejected state, and nothing further happens with that order? Or, once rejected, is it resent by NinjaTrader? or What happens next with this order?
2. Since Stop1 was in the Accepted state, and the strategy had control over the StopLoss, now that the Stop1 order has been rejected, has Long1 been left without a StopLoss? In other words, can the price move against it, and no order will stop it?
3.- In fact, before I trying to manage that error, the strategy closes and let me with Long position without Stop Loss
4. How can I resolve this issue?
Thank You

Comment