OA
Good catch Arnold, thanks. You're right, with lastBar at 0 the first tick after attaching or restarting fires as a new bar even mid candle. The fix is to seed it in OnInit with lastBar = iTime(_Symbol, _Period, 0); so the EA waits for the next real bar open. Agreed on the restart comparison case too, I've added it to the checklist.
