How Intraday Bar Timestamps and Forming-Bar Prices Are Handled
Summary
The document explains how a trading data entity represents intraday minute and hour bars. Bars are timestamped at the start of their interval, and historical data includes a bar once its full interval has elapsed, even when the next bar has not yet appeared. This timing matters when a strategy decides which observations are available at a given point.
For a bar that is still forming, last-price and close-derived quote values use the bar’s open rather than a close that has not occurred yet. Polars-backed data follows the same convention for nanosecond, microsecond, and millisecond timestamp precision, while actual quote snapshots retain different pricing semantics. Overnight gaps do not define the duration of intraday bars; when sparse samples provide no intraday spacing, the nominal minute or hour interval is used. The notes specify data-handling behavior but provide no examples, market results, or broader guidance on applying it, so users should account for these conventions when aligning signals and prices.
Key ideas
- Intraday minute and hour bars are timestamped at the beginning of their intervals.
- A completed bar can appear in history before the following bar arrives.
- While a bar is forming, close-derived prices use its open rather than a future close.
- Polars-backed data applies the same bar rules across supported timestamp precisions.
- Overnight gaps do not set intraday bar duration, and sparse data uses the nominal interval.
Tags
Full text
# entities.data Data ---------------------------- .. meta:: :description: Data LumiBot documentation in the LumiBot Python trading framework. Intraday bar visibility ~~~~~~~~~~~~~~~~~~~~~~ Minute and hour bars are timestamped at their start. History includes a bar after its full interval closes, even if the next bar has not arrived. While a bar is forming, last-price and close-derived quote prices use its open rather than its future close. Polars-backed data applies the same rules for nanosecond, microsecond, and millisecond timestamps. Actual quote snapshots retain their separate pricing semantics. Overnight gaps do not establish an intraday bar's duration. When sparse samples contain no intraday spacing, the nominal minute or hour interval applies. .. automodule:: lumibot.entities.data :noindex: :members: :undoc-members: :show-inheritance:
Shown in full with attribution under the source's licence. Licence: GPL-3.0
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.