Want to give EX4 file of my EA to my friend.

 

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.

 

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

Look for a match between the array and AccountNumber()

 

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 );
...
}
Reason: