Live account or Demo

 

Hello, what code can I put in an EA to only allow to work on Demo account and not Live account?

Thanks

 

Try IsDemo() if false return();

 

Where to place the code

InTrance:
Try IsDemo() if false return();

Where should I placed this code in the program?

Sorry..I'm newbie..

 
starbisnis:
Where should I placed this code in the program? Sorry..I'm newbie..

you can add after the start ()

 
matrixebiz:

Hello, what code can I put in an EA to only allow to work on Demo account and not Live account?

Thanks

if(IsDemo()) MessageBox("Congratulations! EA activated for your Demo. Click OK"); //if account is demo it will give this message and allow trade

  else

{

if(!IsDemo()) Alert("Use Demo account"); //this check if account is demo and if its not demo it will give alert and stop working

  ExpertRemove(); // bot will be removed on chart

  }