I need to Lock my expert based on my account number and borker

To add comments, please log in or register
Mohamed Abdelwaged
238
Mohamed Abdelwaged  
I need a help how to lock my EA/Script based on my login account number and one broker only such as "FXDD" ?

example:
my login number in my broker "FXDD" is 12345 , and I want my EA/Script can run only in that login number and FXDD broker.


please help

NOTE:
better if you can give me an example of one EA and script that contains about this and how to put it -> because I'm a newbie and need a help to lock my EA/Script
Marco vd Heijden
Moderator
8167
Marco vd Heijden  

So why exactly do you want to do that ?

Mohamed Abdelwaged
238
Mohamed Abdelwaged  
Marco vd Heijden:

So why exactly do you want to do that ?

I have to give it to a friend and don't want to him to sell it ..
Carl Schreiber
Moderator
7105
Carl Schreiber  
You can give him the inverstor-password. With this access you can only watch but not act.
Mohamed Abdelwaged
238
Mohamed Abdelwaged  
Carl Schreiber:
You can give him the inverstor-password. With this access you can only watch but not act.
I want to apply the EA on his account . but only on his account number and broker
Anton Nel
49586
Anton Nel  

Example for MT4 EA:

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   int AccountLists_AcceptData[];
   int number_of_accounts = 3;
   ArrayResize(AccountLists_AcceptData, number_of_accounts);
   AccountLists_AcceptData[0] = 14320579; 
   AccountLists_AcceptData[1] = 2009407; 
   AccountLists_AcceptData[2] = 609114; 
   
   bool isAccountNumberOK = false;
   for (int i = 0; i < number_of_accounts; i++)
   {
      if (AccountNumber() == AccountLists_AcceptData[i])
      {
         isAccountNumberOK = true;
         break;
      }
   }

   if (!isAccountNumberOK)
   {
      Print("License is not authorized! Contact Mohamed Abdelwaged");
      return(INIT_FAILED);
   }
   else
   {
      return(INIT_SUCCEEDED);
   }
}
Mohamed Abdelwaged
238
Mohamed Abdelwaged  
Anton Nel:

Example for MT4:

thanks too much Anton

however the print order

Print("License is not authorized! Contact Mohamed Abdelwaged")

did not appear when I try it on another account number not listed and the EA terminated 

another thing how can I specify the Broker to such as "FXDD"

Anton Nel
49586
Anton Nel  
Print("Name of broker: " + AccountCompany());
if (AccountCompany() != "FXDD")
{
  return(INIT_FAILED);
}
Mohamed Abdelwaged
238
Mohamed Abdelwaged  
Anton Nel:
It Works .. really appreciated .... ♥ 
To add comments, please log in or register