Does this following line refer to the sim account or just a live account position?
// If the strategy has terminated reset the strategy id
else if (atmStrategyId.Length > 0 && GetAtmStrategyMarketPosition(atmStrategyId) == Cbi.MarketPosition.Flat)
Print("Idle");

Comment