HosseinKOGO: Should I store the values in a file in OnDeinit function and recover them in OnInit function after next start? I have no idea how to do this
-
That's the only way for many values. A small number can use Global Variables.
-
Perhaps you should read the manual. File Functions
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
William Roeder #:
Appreciated!-
That's the only way for many values. A small number can use Global Variables.
-
Perhaps you should read the manual. File Functions
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
You've addressed me exactly what I was looking for.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all,
Let's say I have an array which my EA put values for each element after closing each position. But when I restart my VPS, my EA put default values for each element of this array rather than recent values.
Should I store the values in a file in OnDeinit function and recover them in OnInit function after next start? I have no idea how to do this, so it would be greatly appreciated if you give me an example code of how to do this.
Another question is: Is it a safe way? What will happen if my VPS turns of suddenly and my EA had no time to run OnDeinit() before turning off?