Can Someone tell me how to put protection in my EA ??

 

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);






 
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?

Reason: