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.

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
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?