I need to Lock my expert based on my account number and broker
So why exactly do you want to do that ?
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.
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); } }
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); }
should put it this way? hope you can help, it does not work for me
Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!

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