How to use complex operators

 

Hi,
How can I combine two 'if' Operators?
My purpose 'Special sets...' will apply two 'if' Operators.
Best

// Main Operator
if( a == b && c == 0 )
    ObjectCreate( str name, int type=OBJ_VLINE, int window, dtt time1, dbl price1 );
else
// Special sets which one I want to set all my Object Vertical Lines
    ObjectSet( str name, int index, dbl value );
    ...

// This Operator which one I want to appropriation above Special Sets...
if( d && e && c == 0 )
    ObjectCreate( str name, int type=OBJ_VLINE, int window, dtt time1, dbl price1 );
 
Max Enrik:

Hi,
How can I combine two 'if' Operators?
My purpose 'Special sets...' will apply two 'if' Operators.
Best

// Main Operator
if( a == b && c == 0 )
    ObjectCreate( str name, int type=OBJ_VLINE, int window, dtt time1, dbl price1 );
else
// Special sets which one I want to set all my Object Vertical Lines
    ObjectSet( str name, int index, dbl value );
    ...

// This Operator which one I want to appropriation above Special Sets...
if( d && e && c == 0 )
    ObjectCreate( str name, int type=OBJ_VLINE, int window, dtt time1, dbl price1 );

Please see ternary operator:

https://www.mql5.com/en/docs/basis/operators/ternary

Documentation on MQL5: Language Basics / Operators / Ternary Operator ?:
Documentation on MQL5: Language Basics / Operators / Ternary Operator ?:
  • www.mql5.com
Language Basics / Operators / Ternary Operator ?: - Reference on algorithmic/automated trading language for MetaTrader 5
 
Marco vd Heijden:

Please see ternary operator:

https://www.mql5.com/en/docs/basis/operators/ternary

Big thanks, that helped me a lot.