Skip to content

Preserve configured aggregation intervals across UTC boundaries #120

Closed

Description

@stefan-jansen

Problem

Public BarAggregator resets configured intervals at hour or UTC-date boundaries. This changes OHLCV grouping and can emit overlapping completed intervals. This is the aggregation problem reported in #111 and contributed in #112.

Reproduction and evidence

Use the valid typed trade feed in tests/unit/test_bar_aggregator.py through the public async aggregator:

uv run pytest -q tests/unit/test_bar_aggregator.py -k 'bar_windows or boundary_and_shutdown'

  • Original source 2ad36a8 splits a 90-minute interval at each hour, producing three bars instead of two at 10:30 and 12:00.
  • Partial source 1af9309 passes the hour and shutdown controls but fails the same midnight regression: one 100-minute bar ends at 01:00 while the next starts at 00:00.
  • Fix 69f3fa8 passes all 15 aggregator tests in 1.81s, including exact timestamps, interval metadata and OHLCV for both scenarios. Ruff, formatting, ty and commit hooks pass.

Expected behavior and completion

Intervals retain their configured duration across hours and UTC dates. PR #125 aligns intervals from 1970-01-01T00:00:00Z and documents that origin. Existing minute-bar and shutdown behavior must continue to pass.

Require all current-head hosted stable, ecosystem and strict-documentation checks, then merge the verified fix. Source 462a163 also integrates the merged IB change without altering the tested aggregation source or regressions. No release or provider qualification is included.

AI assistance

Cursor prepared the original contribution. Codex reproduced both boundary failures, completed the interval algorithm, documented its origin and ran verification.

Activity

  1. added
    type: bugConfirmed or reported incorrect behavior
    compatibility: affectedHas Python, platform, dependency, or cross-library compatibility impact
    on Oct 17, 2026
  2. changed the title [-]Preserve aggregate bar windows across hour boundaries[/-] [+]Preserve configured aggregation intervals across UTC boundaries[/+] on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibility: affectedHas Python, platform, dependency, or cross-library compatibility impactpriority: normalNormal planned workstatus: acceptedAccepted for implementationtype: bugConfirmed or reported incorrect behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions