NinjaTrader Rejecting Stop Orders
This is a common occurrence when using stop orders. A Sell Stop order must be placed at a price below the current bid. Similarly, a Buy Stop order must be placed at a price above the current ask. What is happening is when all of the conditions are met for an entry, the strategy will place a Sell Stop order at a price specified by the strategy. However, in fast moving or illiquid markets (markets with a wide spread), it is possible that the current bid has moved below this price before the order is received by the exchange. In this scenario, the order will be rejected. There are a few ways to handle the issue, each with pros and cons:
- Set the strategy to ignore rejected orders. In this case, the strategy would miss the trade but it would not shut down due to the rejected order. So it would continue trading when another signal is generated.
- Set the strategy to issue a market order when an order is rejected. In this case, the strategy would still issue the stop order that is getting rejected. Upon receiving notice that the order was rejected, the strategy would then place a market order to enter the trade.
- Add a check in the code to ensure that the Stop Price is ‘x’ number of ticks below the current bid price. In this case, when the strategy generates an order, it would compare the entry price with the current bid price to ensure that the order is ‘x’ number of ticks below the current bid price. We can either ignore the trade or issue a market order if the entry price is not ‘x’ ticks below the current bid price. With this option, it is still possible for the order to be rejected since the bid can move ‘x’ number of ticks before the exchange receives the order. Therefore we would have to make sure to set ‘x’ to a high enough value that this does not happen.
- Use synthetic stops. A synthetic stop resides on your computer instead of at the broker/exchange. So when the strategy generates a signal, instead of placing a stop order at the broker/exchange, it will store the price in memory. It will then monitor the market on a tick by tick basis, and issue a market order when the price is hit.