I haven't looked closely at your code, but if you only want to check closed bars, use index(shift) 1 not 0.
//---------------------------------------------------------------- double RSI_Price = iRSI(NULL,0,14,0,0); double STOC_Price = iStochastic(NULL,0,5,3,3,0,0,0,0); double BOLI_Price_UP = iBands(NULL,0,20,2,0,0,1,0); double BOLI_Price_DOWN = iBands(NULL,0,20,2,0,0,2,0); //----------------------------------------------------------------
GumRai:
I haven't looked closely at your code, but if you only want to check closed bars, use index(shift) 1 not 0.
Oh, I didn't know that, thanks
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
It is supposed to alert when RSI and stoch are above their overbought (or below oversold) levels and if the price closes above bollinger. It is only supposed to look at values at price close. As of now, I still get alerts if the values say fluctuated above 70 for rsi, or above 80 for stoch, or above the upper band but they didn't finish above, yet I still get the signal? I'm fairly new at this so some help would be greatly appreciated.