My EA should run for specified currency! need support?

 

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.

 
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

 

  1. Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. You wrote
    if (Symbol() == "USDJPY || AUDJPY || NZDJPY") // no such pair "USDJPY || AUDJPY || NZDJPY"
    
    Even if you wrote
    if (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" ) 

  3. if (Symbol() == "USDJPY")
    {
    return(0);
    
    }
    This rejects USDJPY and accepts all others. If you only want those three you'll have to reverse the test
    if ( Symbol() != "USDJPY" && Symbol() != "AUDJPY" && Symbol() != "NZDJPY" ) 
    {
       return(0); // reject symbol
    }
    // symbol is ok

 

Thanks for your support Boeing747 & WHRoeder.

Got it and worked.

Reason: