Because my EA runs on a dedicated server 24/7, I have a fear of the server restarting, and all the variables being reset.
I used to store all variables in text files, and reload them when init() was called. Just to primer this, the MT4 shortcut is in my Startup folder, and it will reload right where it left off after the reboot. Can you imagine all your trade management variables being deleted duirng the reboot???
The new approach is to use only global variables in my code. GVs will stay in MTs memory for 4 weeks after they are set, even after reboots and restarts...
So now my init() check to see if each global variable is set, and if not it sends me an email alerting me.
Some uses for them include:
ticket numbers
invisible stops and tps
balance information
Hope this helps somebody.
I used to store all variables in text files, and reload them when init() was called. Just to primer this, the MT4 shortcut is in my Startup folder, and it will reload right where it left off after the reboot. Can you imagine all your trade management variables being deleted duirng the reboot???
The new approach is to use only global variables in my code. GVs will stay in MTs memory for 4 weeks after they are set, even after reboots and restarts...
So now my init() check to see if each global variable is set, and if not it sends me an email alerting me.
Some uses for them include:
ticket numbers
invisible stops and tps
balance information
Hope this helps somebody.