I have the below piece of code that I use to protect my mt4 and mt5 indicator and ea but presently it is not working on mt4.
I am sorry for the duplicate. Very sorry. Thanks.
Initially, when i set the needed parameters like the password, account number, pairs, timeframe, etc and compile the code either in ea or indicator, the indicator or ea will function just inline with the command I input in the security code e.g if I bind the ea or indicator to an account it will work on that account only, if I bind it to certain pairs or timeframe, or set password for it, such indicator or ea will not work if those parameters are missing.
It does not compile and it gives error in the attached image below
I do use the code on mt4 and mt5 but recently it stopped functioning on mt4. I have tried within my knowledge to fix it to no avail.
Your assistance in fixing the error will be so much appreciated.
Thanks.
https://docs.mql4.com/basis/mql4changes
Old MQL4 compiler | New MQL4 compiler | New MQL4 with #property strict |
... | ... | ... |
Variable scope is from declaration (even in the nested block) to the function end | Ditto | Variable scope is from declaration to the end of the block, in which the variable is declared |
Thanks.
I did add the #property strict but many other issues came up.
Attached is the image of errors it brought after adding #property strict.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello dear developer.
I am an upcoming and improving developer.
I have the below piece of code that I use to protect my mt4 and mt5 indicator and ea but presently it is not working on mt4.
I have tried to fix it but could not.
Please help me with the issue so that it can work on mt4 again.
Thanks