Below is part of my code from a strategy I created. I am calling an ATM strategy from within the code. I would like to be able to cancel the limit order if it's not filled in x number of bars or if price moves x number of ticks from the order. I haven't been able to figure out how to accomplish this. Any help would be appreciated.
// Condition set 1
if (orderId.Length == 0 && atmStrategyId.Length == 0 && ToTime(Time[0]) >= ToTime(StartHour, StartMinute, 0)
&& ToTime(Time[0]) < ToTime(EndHour, EndMinute, 0)
&& < My Condition>
)
{
atmStrategyId = GetAtmStrategyUniqueId();
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(Cbi.OrderAction.Sell, OrderType.Limit, Close[0], 0, TimeInForce.Day, orderId, "TwoBarHighLowATM", atmStrategyId);
}
Thanks
Comment