Skip to content
All library documents

Aggregating One-Minute Bars into Daily Bars by Trading Session

Article vn.py community

Summary

The forum thread discusses converting one-minute market bars into daily bars in VeighNa. The assistant presents two approaches: use the framework’s BarGenerator with a daily interval and a configurable session end, or maintain a custom daily bar by updating its open, high, low, close, volume, turnover, and open interest as minute bars arrive. A daily bar can then be passed to downstream indicators or strategy logic. The response also notes that session end times vary by instrument and market, and that some framework versions may require handling turnover specially.

A participant adds a key data-handling caveat: aggregation should follow the trading day rather than the calendar date. That distinction matters for markets with overnight sessions or nonstandard trading hours. The examples are illustrative forum guidance, not a validation of the code across instruments or framework versions. The thread provides no performance evidence, and the custom approach’s date-change logic may not correctly represent every exchange calendar or session schedule.

Key ideas

  • Minute bars can be aggregated into daily OHLC bars with a built-in generator or custom accumulator.
  • The daily bar combines prices and sums volume and turnover while carrying the latest open interest.
  • The aggregation boundary should follow the instrument’s trading day rather than a simple calendar date.
  • Session end times and data-field requirements can vary by market and framework version.

Tags

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