Skip to content
All library documents

Building Accurate 15-Minute Bars from One-Minute Market Data

Article BigQuant

Summary

This tutorial explains how to aggregate one-minute bars into longer intraday bars, using a Chinese stock session as its example. It shows the standard time-series resampling approach: assign open from the first observation, high and low from the extrema, and close from the last observation. The example demonstrates that a simple fixed-interval resample can create extra buckets around the midday break and the session close, depending on how interval boundaries are defined.

For closer alignment to the exchange schedule, the article describes defining separate morning and afternoon time boundaries and aggregating each interval explicitly. Its example uses inclusive handling at the first interval and excludes the starting minute for later intervals, preserving full boundary coverage. The custom method offers greater control but requires more code and is described as less efficient than built-in resampling. The example is limited to a particular trading schedule; other instruments and sessions need their own boundaries, and the displayed output contains apparent inconsistencies that merit checking against the source bars.

Key ideas

  • Aggregate open, high, low, and close using the first, maximum, minimum, and last one-minute observations, respectively.
  • Fixed-frequency resampling can place closing-minute observations into an unwanted extra bucket.
  • Custom interval boundaries can account for market breaks and session endpoints.
  • Boundary inclusion rules must be chosen carefully to avoid missing or duplicating observations.
  • Exchange calendars differ, so the example schedule should not be applied unchanged to other instruments.

Tags

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