How to code EA to recognize Live vs Demo Account?

 

I have an EA that can execute different branches of trading logic. Each branch is like a separate trading system.

I'm testing a new branch of trading logic and only want it to execute in my Demo Account and not accidentally in my Live Account.

What's the code look like to check whether I have my EA open in my Demo Account vs my Live Account??


Thanks in advance!!

 
if (IsDemo()){
//your code
}

or
if (!IsDemo()){
//your code
}
 
qjol:


Very cool !! Thanks for the assist.
Reason: