Best save-variable state for live trading?

 

I taught it would have been easier to use a bunch of variables defined outside of the start()-function. Because I'm using the same MT instance for development as well, appears like my out-start() variables are being reset whenever I compile something. I've tried taking the .mq4 file out of the experts folder but that didn't help. I'm royally confused now and would like some suggestions on best save-state for variables.

Is it better to:

A) Don't depend on save-value but instead do a search for the value every time? What would be the negative side of using this approach?

B) Use Terminal GlobalVariableSet() variables. Would they not reset like the File Global variables? What would be the negative side of using this approach?

C) Write and Retrieve my save values from a File. Why would this be any safer than MT default avenues of saving variable values?

D) Use outside Start()-Based global variables. How can I stop my save variables from getting over written without using a different MT for developments.

E) All or None of the above. Well I don't know maybe its not possible. Or redundancy is Key?

 

U

I would definitely not use the same instance for dev as live

If forced to for some reason, I would either:-

Write and Retrieve my save values from a File (separate files for dev & live)

Use separate settings libraries

FWIW

-BB-

 

Use separate settings libraries

Now that you mention it, this could be my problem. Tho I'm falling in love with libraries, looks like I may have taken it a bit too far by dumping outside Start() global variables in there. Was under the impression that .ex4 files were independent (unless recompiled). Looks like because it's got the include file, when that include file changes it recompiles also. I'll have to experiment with it to be sure.

I have 3 broker terminals but intend to only use 1, however, their environments are different (Stop_Levels,Leverage etc) that's why I went back to dealing with one instance for everything. Hmmm I wonder if I duplicate the Primary Folder, if that's going to cause new surprises. I'm gonna go experiment with that :)

 

U

> duplicate the Primary Folder

Should be fine - I do that a lot

-BB=

Reason: