Skip to content
All library documents

Building Two-Hour Futures Bars Across Trading Sessions

Article vn.py community

Summary

This forum discussion explains why two-hour bars built from one-minute futures data can differ across platforms. One approach forms bars on fixed clock boundaries; another accumulates 120 minutes of active trading time, skipping exchange breaks and handling the final session close as a special case. For an index futures schedule with a midday break, the default bar generator may therefore produce a different number and placement of bars than a charting platform that follows active trading minutes.

Participants say the framework’s standard bar generator does not support the described session-aware rule, so users needing that convention must implement a custom generator. The discussion also points to the framework documentation for its existing bar-generation behavior. It does not provide code, a complete specification for edge cases, or a worked comparison of resulting bars. A question about how many days of history a loading call retrieves is left unanswered.

Key ideas

  • Fixed clock boundaries and accumulated trading minutes can produce different two-hour bars.
  • Exchange breaks affect bars when duration is measured in active trading time.
  • The default generator discussed does not implement the requested session-aware convention.
  • A custom bar generator may be needed to match another platform’s aggregation rules.

Tags

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