Download MetaTrader 5

multiple conditions to an IF .... ELSE statement

To add comments, please log in or register
thriller372
60
thriller372  

Is it possible to add multiple conditions to an IF...ELSE statement, I have searched for days with no luck. For example:

if(haOpen<haClose) ExtColorBuffer[i]=0.0; // set color DodgerBlue

      else               ExtColorBuffer[i]=1.0; // set color Red
     }
      
//--- done
   return(rates_total);

  }

 I need  IF(haOpen<haClose & "next condition here") ExtColorBuffer[i]=0.0; // set color DodgerBlue 

Thanks for any help 

Alain Verleyen
Moderator
35038
Alain Verleyen  
https://www.mql5.com/en/docs/basis/operations/bool
Documentation on MQL5: Language Basics / Operations and Expressions / Boolean Operations
Documentation on MQL5: Language Basics / Operations and Expressions / Boolean Operations
  • www.mql5.com
Language Basics / Operations and Expressions / Boolean Operations - Reference on algorithmic/automated trading language for MetaTrader 5
thriller372
60
thriller372  
Alain Verleyen:
https://www.mql5.com/en/docs/basis/operations/bool
Excellent thank you, I can't believe I've searched for days with nothing & less than 5 minutes I got the right answer. Much appreciated sir
To add comments, please log in or register