Thread: How to code?
View Single Post
 
Old 10-15-2007, 03:01 AM
jimven's Avatar
jimven jimven is offline
Senior Member
 
Join Date: Mar 2007
Location: Upstate New York
Posts: 124
jimven is on a distinguished road
Using variables in an EA

Remember that any time you store data to temporary variables in an EA, the data will be gone if you reinitialize or restart the EA (or reboot your computer). This could have unexpected consequences regarding your trades. One possibility is that open trades will close, for example.

You can store data to Global Variables (using GlobalVariableSet and GlobalVariableGet). They remain in the terminal for two weeks (I think), even if undisturbed by your EA. But of course such data could quickly become just as problematic as lost data if you have a computer equipment problem.

In any event, your EA should be written defensively to prepare for loss of connection and the possibility of reinitialization.
__________________
Success is more perspiration than inspiration . . .