Download MetaTrader 5
To add comments, please log in or register
Publish your articles and improve your rating!
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.23 00:49 

Hello everyone. This has come up to me where I had sudden blackout and when I managed to get my PC up and running again, I opened the terminal (latest build) and it seems that the GV is gone for good. This has lead me to rebuild the GV from scratch.

I had 2 blackouts and same thing happens to the GV, gone for good.

Anyone experiencing the same problem?

Alain Verleyen
Moderator
28702
Alain Verleyen 2014.08.23 01:59  
Did you use GlobalVariablesFlush() in your code ?
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.23 02:11  

So you saying all this time GV uses memory and will only write-to-disk once the terminal is being closed ?


Hmm ... Where should I use it ? Put it just before of return (0) ?

Or after every GlobalVariableSet ?

Ian Venner
2583
Ian Venner 2014.08.23 21:59  
deysmacro:

So you saying all this time GV uses memory and will only write-to-disk once the terminal is being closed ?


Hmm ... Where should I use it ? Put it just before of return (0) ?

Or after every GlobalVariableSet ?


The GV is not written to file until the EA is unloaded, so yes you need to flush it to file if it is to be crash persistent. Immediately after GVset would probably be the best time.
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.24 00:04  

Thanks.


The settings is the only thing that need to be persistent, the rest is just display information which can be rebuild automatically.

I think I will go for return (0) routine first. If it doesn't work good enough, after every GVSet it is.

/
To add comments, please log in or register