Constructing Higher-Timeframe Candles from Lower-Timeframe Bars
Summary
This educational indicator demonstrates how to reconstruct a higher-timeframe candle from lower-timeframe chart bars without using a built-in higher-timeframe data request. It detects when the selected timeframe changes, captures the new period's open, and updates the running high and low as each lower-timeframe bar arrives. The prior period's close is taken from the last bar before the switch, and plots show the developing values and a candle representation of the completed period.
The example explains an important timing distinction: open, high, and low evolve during the active higher-timeframe interval, while its final close is only available after that interval ends. The script is illustrative rather than a trading strategy and reports no performance evidence. Its daily timeframe is fixed in the example, and reconstructed values depend on lower-timeframe bar data and boundary handling, so users should check alignment and behavior for their chart and intended timeframe before relying on the plots.
Key ideas
- A timeframe boundary can be detected by tracking changes in the selected higher-timeframe timestamp.
- The higher-timeframe open is captured at the boundary, while its high and low update as lower-timeframe bars arrive.
- The completed higher-timeframe close becomes available only after the period ends.
- The example reconstructs and plots candles for demonstration and supplies no trading rules or performance results.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.