sheriffonline :
I would like to run EA for specified currency:
For dingle currency i have used following code:
if (Symbol() == "USDJPY")
{
return(0);
}
Question:
If i want to specify multiple currency shall i use following code?
if (Symbol() == "USDJPY || AUDJPY || NZDJPY")
If its wrong please give me an exact logic to use.
This is a right variant: if ( Symbol() == "USDJPY" || Symbol() == "AUDJPY" || Symbol() == "NZDJPY" )
Sign " || " is word "or" in English
Sing " && " is word "and" in English
Play videoPlease edit your post.
For large amounts of code, attach it.
- You wrote
if (Symbol() == "USDJPY || AUDJPY || NZDJPY") // no such pair "USDJPY || AUDJPY || NZDJPY"
Even if you wroteif (Symbol() == "USDJPY" || "AUDJPY" || "NZDJPY") // if( boolean or string or string ) is nonsense
You need to write if (boolean1 or boolean2 or boolean3):if ( Symbol() == "USDJPY" || Symbol() == "AUDJPY" || Symbol() == "NZDJPY" )
if (Symbol() == "USDJPY") { return(0); }
This rejects USDJPY and accepts all others. If you only want those three you'll have to reverse the testif ( Symbol() != "USDJPY" && Symbol() != "AUDJPY" && Symbol() != "NZDJPY" ) { return(0); // reject symbol } // symbol is ok
Thanks for your support Boeing747 & WHRoeder.
Got it and worked.

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 would like to run EA for specified currency:
For dingle currency i have used following code:
if (Symbol() == "USDJPY")
{
return(0);
}
Question:
If i want to specify multiple currency shall i use following code?
if (Symbol() == "USDJPY || AUDJPY || NZDJPY")
If its wrong please give me an exact logic to use.