Download MetaTrader 5
To add comments, please log in or register
Start making profit using the Market. Publish your product!
Max Enrik
761
Max Enrik 2016.11.09 12:08 

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 );
Marco vd Heijden
Moderator
4507
Marco vd Heijden 2016.11.09 12:42  
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
Max Enrik
761
Max Enrik 2016.11.14 00:55  
Marco vd Heijden:

Please see ternary operator:

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

Big thanks, that helped me a lot.
/
To add comments, please log in or register