Can someone help with this code, been driving me nuts
Try iBarShift(NULL/*current symbol*/, 0 /*current Period()*/, time[i]). If you want to use a period other than current Period() you should calculate it yourself, because the notion of "higher timeframe" may be specific to your use case and requirements.
Here is an example how you can calculate higher timeframes - https://www.mql5.com/en/code/2226
Change Chart and Timeframe
- votes: 6
- 2014.06.06
- eselstreckdich
- www.mql5.com
Modified scripts to change Charts(next,previous) and Timeframes(higher,lower) of all charts quickly by hotkeys.
So this is what I have:
a custom indicator displaying on a chart the values of two standard indicators ATR and MA.
MA on the current chart time frame, no problems, but the ATR is supposed to be for the higher timeframe i got it this far:
I tried to use the iBarShift library on https://www.mql5.com/en/code/1864 didn't work for me, i need to pass the time and how do i get the time in this loop?