Skip to content
All library documents

Calculating Indicators on Incomplete Higher-Timeframe Bars

Article vn.py community

Summary

This Chinese-language forum post concerns calculating higher-timeframe indicators in real time from a lower-timeframe bar callback, such as updating 30- or 60-minute KDJ or RSI while processing five-minute bars. The example creates separate bar generators and array managers for multiple intervals, then attempts to read the current ten-minute bar from the generator inside the five-minute callback.

The reported backtest error occurs because the ten-minute generator’s current bar is still None when that callback accesses its open price. The post shows the failure and its context, but provides no answer or corrected implementation. It therefore highlights an initialization and update-order problem: a higher-timeframe bar may not yet exist at the point of access. No trading performance or indicator results are presented.

Key ideas

  • The post asks how to compute higher-timeframe indicators before those bars have closed.
  • Its example updates separate bar generators and array managers from lower-timeframe data.
  • The reported exception occurs when code accesses a higher-timeframe bar that is still None.
  • The document reports the problem but does not provide a fix or evaluate any trading rule.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.