Difference between a close and open.

 

How would I code something like this: The Close[2] = Open[1] +/- 3 pips. So basically I do not want to see a difference of more than X pips between  the close and an open of the following bar. Is there a function that does it? Because it can a positive or negative value depending on how you subtract it.

Thanks. 

 
MathAbs()
 
Alain Verleyen:
MathAbs()
Something like this? MathAbs (Open[1] - Close[2]) <= 3*myPoint
 

another way


if(Close[2]>= Open[1]-3*Point && Close[2]<= Open[1]+3*Point) bla....
Reason: