How to make an EA not lose data after MT4 shut down? - page 2

 
gordon:
Shutdown is the same as Restart only with longer delay between the time the EA was stopped and the time it continues... This time is what matters, not what happened. You can save a time stamp every call to start() as part of the persistence layer to know this time (roughly).

But then my EA only know that it WAS offline for x hour. maybe too late for profit saving actions.

On a restart i the EA knows that it will be back in a few minutes so i would not make any changes in the orders.

 
zzuegg:

[...] On a restart i the EA knows that it will be back in a few minutes so i would not make any changes in the orders.

I assumed we are talking about an unexpected and unknown shutdown/restart... But it seems like you are talking about a scheduled restart which is what I referred to as an 'expected failure'. Since it's expected, it's easy to deal with.