is it possible to convert EX4 file to MQ4 file.
Not at all. And anyway it's not legal.
Well said ...
I have below code in my EA
if (lots*margin > AccountFreeMargin())
lots = AccountFreeMargin() / margin;
If I put Account number in the brackets i.e. () & compile EA which make EX4 file then will I be able to restrict my EA to specific account number only.
I have below code in my EA
lots = AccountFreeMargin() / margin;
If I put Account number in the brackets i.e. () & compile EA which make EX4 file then will I be able to restrict my EA to specific account number only.
So in other words, you want to protect an EA that you have illegally decompiled ?
I don't think so. He wants to protect his EA and ask if it's possible to get a mq4 file from an ex4. If it was possible it's not worth to add protection in the code.
Regarding the solution, don't forget that protect code using account number must work with demo accounts too, if you will enable your users use it.
In this sense, you have to enable demo accounts and/or check if you are really using a real account.
Regarding the solution, don't forget that protect code using account number must work with demo accounts too, if you will enable your users use it.
In this sense, you have to enable demo accounts and/or check if you are really using a real account.
Nice point. It would be great if you could share a couple of sample code for doing that job or any link we can learn that.
To be honest, I don't think that Account Number limitation is a good idea for customers.
Anyway, maybe a good start to do this is study more Account Properties (link below).
https://www.mql5.com/en/docs/constants/environment_state/accountinformation
For instance, ENUM_ACCOUNT_TRADE_MODE and ACCOUNT_TRADE_MODE_REAL can help you identify and protect just real accounts.

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use