Perhaps you should read the manual. |
dir=((OP==OP_BUY)?1.0:-1.0); |
Equivalent to: |
if(OP==OP_BUY) dir= 1.0; else dir=-1.0; |
Ternary Operator ?: - Operators - Language Basics - MQL4 Reference | Works on either side of the equals |
This works in the debugger: |
(b ? x : y) = z; |
Equivalent to: |
if(b) x = z; else y = z; |
thanks dear for your valuable time and fruitful comments,
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
can some one explain the logic
dir=((OP==OP_BUY)?1.0:-1.0);