Download MetaTrader 5

Sudden blackout and GV gone

To add comments, please log in or register
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI  

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
31185
Alain Verleyen  
Did you use GlobalVariablesFlush() in your code ?
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI  

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
2584
Ian Venner  
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  

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