Is it possible to retain a variable double in memory, that is calculated inside an EA, that will stay in memory when a computer is restarted?
Thanks for any help... couldn't find the answer in Documentation or by Search....
I'm thinking GlobalVariableSet() may do it...can anyone confirm this?
Yes, the Global Terminal Variables is the answer!
EDIT: Just remember to flush them regularly using GlobalVariablesFlush() to prevent loss of data in case of a application or computer crash.
I've never used GlobalVariablesFlush() before...but it seems like a great plan. Does each GlobalVariableSet() that I create need to be "Flushed" after I set them? or does one GlobalVariableFlush() save them all? The documentation seems to be ok using it once to save all...
Not sure how that can be tested without having a crash LOL
I've never used GlobalVariablesFlush() before...but it seems like a great plan. Does each GlobalVariableSet() that I create need to be "Flushed" after I set them? or does one GlobalVariableFlush() save them all? The documentation seems to be ok using it once to save all...
Not sure how that can be tested without having a crash LOL
It flushes any and all pending data. In my own code, I use it every time I update a block of global terminal variables, but also for individual updates when necessary.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Is it possible to retain a variable double in memory, that is calculated inside an EA, that will stay in memory when a computer is restarted?
Thanks for any help... couldn't find the answer in Documentation or by Search....
I'm thinking GlobalVariableSet() may do it...can anyone confirm this?