Skip to content

fix: preserve aggregation intervals across hours and UTC dates - #125

Closed
stefan-jansen wants to merge 7 commits into
mainfrom
fix/aggregate-bar-windows
Closed

stefan-jansen wants to merge 7 commits into
mainfrom
fix/aggregate-bar-windows

Conversation

@stefan-jansen

@stefan-jansen stefan-jansen commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

BarAggregator must retain the configured interval across hour and date boundaries. Align starts to fixed UTC intervals from the Unix epoch. The previous hour-based truncation split 90-minute OHLCV; a midnight-based repair still emitted overlapping 100-minute intervals when trades crossed a UTC date.

Closes #120. Resolves the aggregation part of #111. Retains the original 90-minute regression from #112 by quantum-like/Cursor Agent and completes the interval fix.

Public regression commands:

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

Evidence:

  • Producing base 2ad36a8 emits three hourly windows instead of the expected two 90-minute windows at 10:30 and 12:00, with incorrect OHLCV grouping.
  • Partial producer 1af9309 passes the hour and shutdown controls but fails the unchanged midnight regression: its first bar ends at 01:00 while the next starts at 00:00. Valid typed trades drive the real public aggregator.
  • Fix 69f3fa8 passes all 15 aggregator tests in 1.81s, including exact timestamps, non-overlapping metadata and OHLCV for both interval sizes. Ruff, formatting, ty and all commit hooks pass. The feed guide documents the UTC origin.
  • Current head 462a163 integrates merged IB main. Its aggregation source, regressions and guide are identical to the tested fix. Full current-head stable, ecosystem and strict-docs qualification remains required before merge.

No release or credentialed 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.

dependabot Bot and others added 3 commits October 7, 2026 02:36
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.7.0...2.8.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.8.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bar starts were truncated with minute-of-hour arithmetic. A size that does
not divide 60, including 90-minute bars, restarted every hour and split one
window into two.

Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 14:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@stefan-jansen stefan-jansen added type: bug Confirmed or reported incorrect behavior priority: normal Normal planned work status: accepted Accepted for implementation compatibility: affected Has Python, platform, dependency, or cross-library compatibility impact labels Oct 17, 2026
@stefan-jansen stefan-jansen changed the title fix: preserve aggregate bar windows across hour boundaries fix: preserve aggregation intervals across hours and UTC dates Oct 17, 2026
@stefan-jansen

Copy link
Copy Markdown
Contributor Author

Superseded by the combined maintainer-directed maintenance PR #121 to avoid qualifying and merging this queue separately. This PR head and its regression/documentation evidence are preserved in #121 and in a verified recovery archive. The accepted issue remains open until the combined fix lands; this closure does not claim the fix is merged. Follow-up work continues in #121.

@stefan-jansen
stefan-jansen deleted the fix/aggregate-bar-windows branch October 18, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility: affected Has Python, platform, dependency, or cross-library compatibility impact priority: normal Normal planned work status: accepted Accepted for implementation type: bug Confirmed or reported incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve configured aggregation intervals across UTC boundaries

3 participants