I'm using an automated strategy on a 10 min chart. If the bar following the entry signal hasn't made a higher high (for Longs), the order is automatically cancelled after the bar has closed, ie an unfilled order can't be active for longer than 10 min. Now, if the next bar represents a valid entry signal again and the prior signal was cancelled, the strategy should trigger an automated order again, but as my code stands today it doesn't. The second order is simply ignored. I'm posting the code snippet below and would very much appreciate any input that solves this issue. Thanks in advance.
if(!orderPlacedLong && my criteria here)
{
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit,High[0]+1*TickSize,High[0]+1*TickSize, TimeInForce.Day, orderId, "MyStrat", "testStrategyIdValue");
orderPlacedLong = true;
}
else if (orderPlacedLong == true && High[0] <= High[1])
{
AtmStrategyCancelEntryOrder(orderId);
}
Comment