PDA

View Full Version : Rejected limit orders programmatic notification


nailz420
05-13-2010, 09:44 PM
Testing with NT7B15. While testing with market replay connection I receive an error such as this:

5/13/2010 11:35:38 PM Order Market Replay Connection, Sell stop or sell stop limit orders can't be placed above the market. affected Order: Sell 1 Stop @ 1194.25

I have an OnOrderUpdate method and I receive no notification of this rejected order in it. Is there a way to receive some kind of notification in the strategy of this rejection?

Thanks,
Tim

NinjaTrader_Bertrand
05-14-2010, 04:44 AM
Tim, in NT 7 the IOrder objects would also offer the Error / NativeError properties for getting those notifications.

Alternatively you could just check for the 'rejected' orderstate of your IOrder -

http://www.ninjatrader.com/support/helpGuides/nt7/iorder.htm?zoom_highlightsub=IOrder

If you want to handle the rejection in your custom code and leave the strategy running, please work with the RealTimeErrorHandling set to TakeNoAction (of course using this adds a layer of responsibility to your coding) -

http://www.ninjatrader.com/support/helpGuides/nt7/realtimeerrorhandling.htm?zoom_highlightsub=IOrder

nailz420
05-15-2010, 07:58 AM
I found that its coming from a non-simulated trailstop order. I wasn't catching it in the OnOrderUpdate method because its order object did not equal to the one I was tracking. Once I changed it to simulated trailstop, the rejections stopped.

Tim.