Quote:
|
Originally Posted by pawang
Hi
I am so sorry if my question is very basic.
I am learing mql4.
Please help me how to express this math conditions in mql4:
IF( (A>B) AND (|X| <1) AND (Y<Z) ) then.. ... ... ...
|X| is absoulute; it means (X < -1) OR (X> 1)
I got messege from MetaEditor
" IF EXPRESSION IS TOO COMPLEX"
After many times trying,... I have no more Idea..So please tell me how to..
Thanks
|
if(a>b && (x < -1 || x > 1) && y<z){
;your code
}
or maybe x == 0 instead of (x < -1 || x > 1) because only way MathAbs(x) < 1 is true when x=0
http://docs.mql4.com/basis/operations/bool
on the other thought maybe you simply need this:
if(a>b && x<1 && y<z)
or this
if(a>b && x<-1 && y<z)
since x is never 0 or -1 according to your definition
I am confused by your definition of absolute value