nautilus_trader icon indicating copy to clipboard operation
nautilus_trader copied to clipboard

Refactor time-based bar aggregation

Open stastnypremysl opened this issue 6 months ago • 1 comments

Draft Pull Request

Summary

  • interval_type type from str to enum
  • Refactored TimeBarAggregator.init, so the variable initialization are before methods calling
  • Added validation of time_bars_origin
  • Fixed the first bar issue on left_open interval (https://nt-dist.stty.cz/issues/20250509-1-first-bar-not-generated-on-millisecond-bug/)
  • Fixed the bug with self.next_close_ns doesn't change, when no tick is sent
  • Fixed potential bug with first bar skipped on batch processing
  • Added _invalidate_skip_first_non_full_bar_on_exact_start for batch proccesing
  • Added step validation to BarSpecification
  • TBD

Related Issues/PRs

https://nt-dist.stty.cz/issues/20250509-1-first-bar-not-generated-on-millisecond-bug/

Type of change

  • [x] Bug fix (non-breaking)
  • [x] New feature (non-breaking)
  • [x] Breaking change (impacts existing behavior)
  • [ ] Documentation update
  • [x] Maintenance / chore

Breaking change details (if applicable)

Release notes

  • [ ] I added a concise entry to RELEASES.md that follows the existing conventions (when applicable)

Testing

Ensure new or changed logic is covered by tests.

  • [ ] Affected code paths are already covered by the test suite
  • [ ] I added/updated tests to cover new or changed logic

stastnypremysl avatar May 30 '25 06:05 stastnypremysl

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 16 '25 19:06 CLAassistant

Closing this, as the change have been/will be distributed across different PRs.

stastnypremysl avatar Jul 21 '25 22:07 stastnypremysl