Shouldn't be:
When testing and optimizing the Expert Advisors that use global variables, keep in mind that client terminal and the Strategy Tester
share common global variables. Therefore, the names of the global
variables must be different from the names of the global variables used
by other mql4 programs. Otherwise, it may lead to incorrect work of mql4
programs and inaccurate testing results. -- Global Variables of the Client Terminal - MQL4 Documentation
Well I now found out it is not the debugger!
Just requesting one variable wipes out all - useful feature!
This is set by my script:
Now my EA wants to request the first two variables like:
globNameRiskAcct = "PTC Risk Acct:"+(string)AccountNumber(); globNameRiskMagi = "PTC Risk Magi:-548436835"; bool a = GlobalVariableCheck(globNameRiskAcct), b = GlobalVariableCheck(globNameRiskMagi), c = (a) ? GlobalVariableGet(globNameRiskAcct,AccWeight) : false, d = (b) ? GlobalVariableGet(globNameRiskMagi,MagWeight): false; ..
After this little bit of code the List of global variables looks like:
Does this happen to anybody else?
Gooly
gooly: Does this happen to anybody else? |
|
I found it:
A function called in OnDeInit() contains GlobalVariablesDeleteAll() that deletes all global variables.
But now I don't understand why the global variables were deleted at the start of this EA and before OnInit() was executed?
OnDeInit() shouldn't have been touched at all at this moment!
Thank you!
Gooly
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,
I just have recognized that a list of global variables (GlobalVariableSet(..)) disappear?
At least as soon as I start the debugger the whole list is wiped out - before my code tries to request the variables or their values?
Does anybody what I can do??
Thanks in advance!
Gooly