Global Variable got deleted

 

my vps got restarted due to some server issue

my trade got closed today when the market opens and i suspected it is due to the global variable got deleted

I'm not able to do a check on the list as I code my EA to delete the GV when trade exit.

anyone experience this? 

 
Does global variable gets deleted when mt5 restarts?
 
you can use this one instead of that one
 
song_song:
you can use this one instead of that one
I'm actually using that
 
doshur:
Does global variable gets deleted when mt5 restarts?

No Global Variables of the Terminal are not deleted when MT5 restarts. Check your code.

Global variables are kept in the client terminal within 4 weeks since the last access, then they will be deleted automatically. An access to a global variable is not only setting of a new value, but reading of the global variable value, as well.

 

Global variables can be lost when your MT5 stops abnormally.

Use GlobalVariablesFlush() to protect them.

 
Wahoo:

Global variables can be lost when your MT5 stops abnormally.

Use GlobalVariablesFlush() to protect them.

Yes, my mt5 stops because the server restarts abnormally.

Thanks for the info 

Reason: