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.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.