Skip to content
All library documents

How BarGenerator Closes Minute-Based Time Windows

Article vn.py community

Summary

This short post raises a question about how a BarGenerator routine determines when to finish a multi-minute bar. It points to a condition that checks whether the current minute, incremented by one, is divisible by the configured window size. The author uses a five-minute window as an example and asks whether a bar timestamped at 21:45 should cover the minutes from 21:41 through 21:45, while the condition appears to close a window spanning 21:40 through 21:44.

The post supplies a code excerpt and a concrete boundary case, making it useful for understanding how timestamp conventions affect bar aggregation. However, it contains no reply or resolution, so it does not establish whether the observed interval is a bug or an intended convention. It gives no strategy, market evidence, or guidance on handling session boundaries, timestamps, or missing bars.

Key ideas

  • The post questions how a minute-based bar generator decides when a multi-minute window is complete.
  • Its example contrasts a five-minute interval ending at 21:45 with one apparently spanning 21:40 through 21:44.
  • The code checks whether the incremented minute is divisible by the configured window size.
  • The post does not include an answer, so the intended timestamp convention remains unresolved.

Tags

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