MT4, MT5 - EA restarting everything after terminal restart instead of resuming the work

 

every time my computer hangs strategies instead of resuming open positions just start all over again.
Is it possible to make them resume work or to program EA in such way so it would resume the activity instead of reseting it every single time.
This is most annoying thing for me in both metatrader... unbelievable that even restart (not hanging) does not keep the EA work.

I quit providing the signals for now i think as it works like c**p, without some dedicated linux computer that doesnt hang or turn off for 2 years.

Is there any way to program an EA to avoid issues with terminal restart?

 

Save the used parameters and the internal state to a file on OnDeinit. The name of the file could be one parameter.

OnInit check for existance of such a file and load its content into the internal state if the parameters are identical.

I assume that you check for an open position in a symbol independent of your internal state.

So you could in addition handle manual closing and opening of postions.

 
ugo58:

Save the used parameters and the internal state to a file on OnDeinit. The name of the file could be one parameter.

OnInit check for existance of such a file and load its content into the internal state if the parameters are identical.

I assume that you check for an open position in a symbol independent of your internal state.

So you could in addition handle manual closing and opening of postions.

Ya or even save used parameters and internal state on each bar or trade or even tick and you'll be protected against "hangs" as well.
Reason: