Saving the breach flag and day-start value together fixes the restart problem you describe. I would also test a restart during the file write: if the saved state is missing or unreadable, new entries should stay disabled until it is restored, rather than use the current equity as a fresh baseline. Does the revised version keep the halt in that interrupted-write case?
Arnold Holm
I turn your trading setup into an MT5 bot with your prop firm's daily and max loss rules built in. Try it free on demo first.
Saving the breach flag and day-start value together fixes the restart problem you describe. I would also test a restart during the file write: if the saved state is missing or unreadable, new entries should stay disabled until it is restored, rather than use the current equity as a fresh baseline. Does the revised version keep the halt in that interrupted-write case?