Suppose an old bar, say index 15 is bullish. The timeframe is 1H. I want to probe for the state (bullish/bearish) and possibly other data (iopen, iclose, EMAs etc.) on each 15M bar that existed inside that one bar when it happened.
How can I achieve that?
TIA
Use iBarShift with the time of the H1 bar. That will find the first M15 bar.
Then you could theoretically use the shift and the following 3 M15 bars but that is assuming that there are 4 M15 bars that relate to the H1 bar.
So you should check that all 4 bars have the same hour. You could check this by using iBarShift again with each time of the M15 bars and making sure that it takes you to the original H1 shift.
Suppose an old bar, say index 15 is bullish. The timeframe is 1H. I want to probe for the state (bullish/bearish) and possibly other data (iopen, iclose, EMAs etc.) on each 15M bar that existed inside that one bar when it happened.
How can I achieve that?
TIA
use the H1 bar time and the third form of copyrates, this will allow you to specify a start time (H1 bar time) and end time (H1 bar time + 1 hour) that you require the smaller timeframe bars for
https://www.mql5.com/en/docs/series/copyrates

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Suppose an old bar, say index 15 is bullish. The timeframe is 1H. I want to probe for the state (bullish/bearish) and possibly other data (iopen, iclose, EMAs etc.) on each 15M bar that existed inside that one bar when it happened.
How can I achieve that?
TIA