You have to change the direction of arrays. By default zero refers to the farthest bar in history.
Use ArraySetAsSeries to set the flag to true.
![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
Hello. I am trying to code my first Expert Advisor in MQL5, and I am having an issue getting the correct values from indicators, specifically RSI and ATR in my case.
This is the code I am using:
And as you can see from this screenshot, I am getting different values from the indicator on the chart and the EA.
I have been trying to figure this out for a while, and I am stuck. Does anyone know the issue? I would really appreciate a helpful eye.