Weekend Gaps Problem

 

Hey guys,

i am working on an EA in H1 Period and have to solve a probem with (weekend) gaps. I dont want it to open trades after a price gap of more than 10 pips occured.


Tried to solve this with:

if ((Close[1]-Open[0])/(PipValue*Point) > 10)

and

if ((Close[1]-Open[0])/(PipValue*Point) < 10)

but it does not to work.


How to descrribe a gap?

Thanks in advance.

Edit:
Solution: http://forum.mql4.com/46154