MQL4 - automated forex trading   /  

Forum

EA Runtime Variables

Back to topics list To post a new topic, please log in or register

avatar
52
psousa 2011.05.10 16:04 

Hi,

I'm developing an EA that keeps in variables several "dynamic" parameters. In case of a crash or just a shutdown how should I "save" these parameters?

1-"dump" the variables into a text file and load it at startup/init section?

2-Using global variables?


Any sugestions?

Best regards


Paulo



Market Diagnostics by Pulse

Market Diagnostics by Pulse

In the article, an attempt is made to visualize the intensity of specific markets and of their time segments, to detect their regularities and behavior patterns.


avatar
438
forexCoder 2011.05.10 16:42 
What kind of crash?

avatar
52
psousa 2011.05.10 17:32 
forexCoder:
What kind of crash?


Power fail, HDD Fail, Hardware errors


avatar
438
forexCoder 2011.05.10 17:42 
psousa:

Hi,

I'm developing an EA that keeps in variables several "dynamic" parameters. In case of a crash or just a shutdown how should I "save" these parameters?

1-"dump" the variables into a text file and load it at startup/init section?

2-Using global variables?

In case of a power failure, HDD fail, or hardware errors you usually won't have enough time to instantly dump variables into some file on disk as the errors happen instantly.

However it is entirely possible that during the EA execution, every time your EA does something, you write it to file. It's safe(r) that way, but you still won't be able to 100% guarantee your data in case of HDD failure, lightning strikes, rain in your PC, stuff like that.

For a higher chance of succesfully saving your data, I suggest having another program back up your files to multiple locations. I'd suggest RAID field as well, but i have had bad experience with it.


avatar
571
brewmanz 2011.05.12 12:50 

another option ('off-site backup') is to email yourself the variables every so often

*edit* from the EA, that is

Back to topics list  

To add comments, please log in or register