Download MetaTrader 5
To add comments, please log in or register
Publish your article to let the traders see it in MetaTrader 5!
rchandek 2014.04.30 16:01 

I want to Want to give EX4 file of my EA to my friend. But want to make it sure that he will use it on his trading account only.

What Code I can put to ensure that my EA will be used for specific trading account number. So that I can add friends account number & then compile EA & then give it to my friend as gift.

honest_knave 2014.04.30 17:30  

Create an array with all the account numbers you want to allow.

Look for a match between the array and AccountNumber()

Carl Schreiber
Carl Schreiber 2014.04.30 19:24  

what about this:

//  place the digits of his account in key1;
#define key1  11018552855806481660
         //   18446744073709551615    biggest possible long-value, key1 MUST be smaller!! 
int OnInit() {

        if ( StringFind( (string)key1, (string)AccountNumber() ) < 0 ) return( INIT_AGENT_NOT_SUITABLE );
To add comments, please log in or register