Download MetaTrader 5

multiple conditions to an IF .... ELSE statement

To add comments, please log in or register
Publish your article and win recognition from thousands of traders!
thriller372
60
thriller372 2016.06.20 16:30 

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
30743
Alain Verleyen 2016.06.20 16:39  
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 2016.06.20 16:46  
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