Download MetaTrader 5

Wait for Indicator cross

To add comments, please log in or register
Having difficulties in understanding the Trading Signals service? Read the article!
Chris 2015.11.13 20:00 


 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. 

whroeder1 2015.11.14 01:28  
variable are reset unless they are static or globally declared
To add comments, please log in or register