This morning I witnessed my strategy issue a sell order that also triggered the associated stop loss and profit target orders. The stop loss was very tight and triggered very quickly. So quickly in fact that the profit target order could not be cancelled because of its status and instead got rejected. According to NT documentation it states that when a stop loss or profit target order (from ATM or Strategy) gets rejected that all associated orders will get cancelled. But that is not what happened here. The buy profit target order that was rejected did not get canceled and instead spawned into a buy order that did not come from the strategy. To me that is a serious issue. Now I have to find a way to deal with this bizarre situation where the strategy creates stop loss or profit target orders that don't get canceled and instead get rejected. The concern is that "runaway orders" get created because these stop loss or profit target orders get rejected and then sit out there and create unintended buy or sell orders.
So in light of this how can I code to have a strategy on 60 minute bars to go out and check to see if the strategy has any active orders that fall below a set P/L? Since the strategy runs at the close of the bars how can I have it make it check on the orders associated with it on price change instead?
Given what happened I don't feel comfortable letting these strategies run with real money when I'm not near the computer. Any ideas how I could handle this?
Jeff B.
Comment