paulosouza89:
I'm having problems, to make this code work. I just want my EA to work on demo accounts, for testing purposes. Then I want to make it only work on specific accounts, example "account = 22031989" I saw this in the manual, but I do not know how it works.
Thank you :D // + ----------------------------------------------- ------------------- + ENUM_ACCOUNT_TRADE_MODE tradeMode = (ENUM_ACCOUNT_TRADE_MODE) AccountInfoInteger (ACCOUNT_TRADE_MODE); if (tradeMode == ACCOUNT_TRADE_MODE_DEMO) return (true); // tradeMode is ACCOUNT_TRADE_MODE_CONTEST or ACCOUNT_TRADE_MODE_REAL return (false);
To make it work on Demo Accounts you can simply use the function
//---------------------
If (IsDemo())
{
....code here
}
//-------------------
For specific account number you can use
//---------------------
If(AccountNumber()==*********)
{
.........code here
}
//-----------------------
where *****= 22031989 from your example .
Nesimeye Oswald:
To make it work on Demo Accounts you can simply use the function
//---------------------
If (IsDemo())
{
....code here
}
//-------------------
For specific account number you can use
//---------------------
If(AccountNumber()==*********)
{
.........code here
}
//-----------------------
where *****= 22031989 from your example .
thank you for your help Oswald.
but you wrote "....... code here " what does it means?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I'm having problems, to make this code work. I just want my EA to work on demo accounts, for testing purposes. Then I want to make it only work on specific accounts, example "account = 22031989" I saw this in the manual, but I do not know how it works.
Thank you :D // + ----------------------------------------------- ------------------- + ENUM_ACCOUNT_TRADE_MODE tradeMode = (ENUM_ACCOUNT_TRADE_MODE) AccountInfoInteger (ACCOUNT_TRADE_MODE); if (tradeMode == ACCOUNT_TRADE_MODE_DEMO) return (true); // tradeMode is ACCOUNT_TRADE_MODE_CONTEST or ACCOUNT_TRADE_MODE_REAL return (false);