PDA

View Full Version : cancel orders


binwang2
09-30-2009, 11:38 AM
Hi NT experts,

Is it possible when evaluating a logic block, an order can be in pending cancel at the begining of the evaluation and then in cancelled staus when evaluating rest of the logic.

Suppose under OnBarUpdate
if (order1 !=null && order1.Filled ==0)
{
CancelOrder(order1);
}

Under OnOrderUpdate, order1 is set to null if cancelled.

Is it possible that when evaluating order1!= null the order staus is pendingcancel, while when evaluating order1.Filled ==0 it is cancelled?

NinjaTrader_Josh
09-30-2009, 11:49 AM
Not sure what you mean. If the order state changes you will receive the event in OnOrderUpdate(). If you have not received this event, your code will not switch anything for the order state.