Wait for Indicator cross

Back to topics list To post a new topic, please log in or register
avatar
20
marine1983 2015.11.13 21:00
 

Hi,

 I'm really struggling with a what is most likely easy piece of code. I'm new to mql 4 so bear with me. 

 What I'm trying to achieve is this. Wait for the previous bar to close outside of the bollinger bands. Easy enough.

 What i'm struggling with is when this has been achieved I then need to wait for an oscillator to to drop below a line. This could be 5 bars in the future so I need the EA to only calculate the indicator on each new bar. How can I do this? If I have a return; in the code it goes back to the start and turns all my bools back to false. So its a never ending cycle of it turning true only to go back to false on the next iteration. 

  

avatar
12983
WHRoeder 2015.11.14 02:28 #
 
variable are reset unless they are static or globally declared
Back to topics list  

To add comments, please log in or register