I need a sample MQL5 code to lock an ea to one account, can you help me please?

 

Hi all,

before, I had a MT4 ea and a friend gave me this easy code if(AccountNumber()!=123456){return(0);} to lock the ea to my account, but now I have a MT5 ea, I tried the code but didn't work, I found this https://www.mql5.com/en/articles/359 but also didn't work. I hope if someone has an easy code for MQ5.

Regards

 
Tarik Aljanabi: before, I had a MT4 ea and a friend gave me this easy code if(AccountNumber()!=123456){return(0);} to lock the ea to my account, but now I have a MT5 ea, I tried the code but didn't work, I found this https://www.mql5.com/en/articles/359 but also didn't work. I hope if someone has an easy code for MQ5.

In MQL5 you use "AccountInfoInteger( ACCOUNT_LOGIN )" instead of "AccountNumber()". You should learn to read the documentation!

 
Fernando Carreiro:

In MQL5 you use "AccountInfoInteger( ACCOUNT_LOGIN )" instead of "AccountNumber()". You should learn to read the documentation!


Thank you very very much, its worked 100%, I already read before but the mistak was I changed ( ACCOUNT_LOGIN ) with my account number :)


Regards

Reason: