higher timframe control in lower timeframe

 

Hello all,

what is the best way to control a higher timeframe in a smaller one. In other words, how can I programmatically determine when a 4H candle ends (or begins) in a lower timeframe? Is this only possible via the time?
The reason is the following, I have an EA in M15 and want a display of a Bollinger Band in H4. But just only one H4 candle long.
With the following H4 candle the display should disappear again. So I need to know when the H4 candle of the Bollinger analysis in the M15 chart is over.

Thank you and best Regards

 
Frika: what is the best way to control a higher timeframe in a smaller one. In other words, how can I programmatically determine when a 4H candle ends (or begins) in a lower timeframe? Is this only possible via the time? The reason is the following, I have an EA in M15 and want a display of a Bollinger Band in H4. But just only one H4 candle long.

With the following H4 candle the display should disappear again. So I need to know when the H4 candle of the Bollinger analysis in the M15 chart is over.

Yes, "Time"! Buy looking at the time of the candle is the quickest way.

You can either, look at the M15 candle time and detect when a H4 change occurs using simple integer arithmetic, or you can use iTime() to get the time for the H4 candle and detect when it changes.

Using the M15 candle time will probably be the quickest most efficient method.

Reason: