I use this code to disallow more than 2 EA on one mt4 terminal but its operations is not consistent,pls any assistance. Thanks
there are some clear errors in the syntax of your code. The snippet you have sent here will not compile
-
Do not post code that will not even compile. We assume you know the language.
-
Post all relevant code.
How can we know whether you used strict or not.
Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.
-
Where do you call onint?
- What is the purpose of nameea? It is unnecessary.
-
Do not post code that will not even compile. We assume you know the language.
-
Post all relevant code.
How can we know whether you used strict or not.
Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.
-
Where do you call onint?
- What is the purpose of nameea? It is unnecessary.
int onint()
i have removed all errors on the code using #property strict and it compile good..
but i just want to know what am doing wrong now,
#property strict string GLOBAL_NAME = "myeaname"; int init() { //... GlobalVariableSet(GLOBAL_NAME, WindowHandle(Symbol(), Period())); return(0); } int nameea = 0; void OnTick() { if(nameea == 0) { if(GlobalVariableGet(GLOBAL_NAME) != WindowHandle(Symbol(), Period())) { nameea = -1; IndicatorShortName("Program is disabled (duplicate is found)"); Print("Only 1 EA allowed. This one is will not run ."); ExpertRemove(); } else { nameea = +1; } } else if(nameea == -1) { return; } //... }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I use this code to disallow more than 2 EA on one mt4 terminal but its operations is not consistent,pls any assistance. Thanks