Download MetaTrader 5

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

To add comments, please log in or register
rchandek
8
rchandek  

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
Moderator
2373
honest_knave  

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

Look for a match between the array and AccountNumber()

Carl Schreiber
6973
Carl Schreiber  

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