private IOrder EntryOrder;
...
if (Setup) {
EntryOrder = EnterLongLimit(0, true, MyPositionSize, MyEntryPrice, "MySigName");
}
....
if (ToTime(Time[0]) >= 110000) {
if (EntryOrder != null) CancelOrder(EntryOrder);
}
Under normal circumstances, this code works as expected. However, if "Immediately submit live working historical orders" is set, then when I start the strategy after Setup is true, the entry limit gets placed immediately as it should, but the order is not cancelled, if unfilled, at 11:00am.
I suspect NT is issuing the entry order outside of my code, hence the EntryOrder variable is not being set in this case (== null), hence, the CancelOrder method is not being called.
Is there a way for my code to obtain the IOrder value for orders placed immediately by NT when a strategy is started with "Immediately submit live working historical orders" set? Or do you have another suggestion for what I want to accomplish?
Comment