So why exactly do you want to do that ?
Marco vd Heijden:
I have to give it to a friend and don't want to him to sell it ..
So why exactly do you want to do that ?
You can give him the inverstor-password. With this access you can only watch but not act.
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
You can give him the inverstor-password. With this access you can only watch but not act.
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); } }
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"
Print("Name of broker: " + AccountCompany()); if (AccountCompany() != "FXDD") { return(INIT_FAILED); }
Anton Nel:
It Works .. really appreciated .... ♥
int OnInit() {
{
int AccountLists_AcceptData[];
int number_of_accounts = 3;
ArrayResize(AccountLists_AcceptData, number_of_accounts);
AccountLists_AcceptData[0] = 1231;
AccountLists_AcceptData[1] = 2342;
AccountLists_AcceptData[2] = 2323;
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);
}
}
should put it this way? hope you can help, it does not work for me
markpinlac:
...
Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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