Skip to content

Add bar_build_delay to data engine config #2676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2025
Merged

Conversation

faysou
Copy link
Collaborator

@faysou faysou commented May 30, 2025

Pull Request

NautilusTrader prioritizes correctness and reliability, please follow existing patterns for validation and testing.

Summary

  • Add bar_build_delay as params for SubscribeBars and request_aggregated_bars
    Set through data engine config
    Can be useful in a live context to account for network delays.
    Can be useful in a backtest context when aggregating interal bars (themselves aggregated).

Allows a delay when aggregating bars to ensure they are received.
Refactors existing code to allow this.

Set through data engine config
subscribe_bars has a default value of 0
request_aggregated_bars has a default value of 15 and used only when aggregating bars from internal bars (INTERNAL@INTERNAL)

  • Also rename of time_bars_origin to time_bars_origin_offset

Related Issues/PRs

Type of change

  • New feature (non-breaking)

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

@faysou faysou force-pushed the bar_build_delay branch 6 times, most recently from 3d5c2e3 to d27bd97 Compare May 31, 2025 12:32
@faysou faysou changed the title Add bar_build_delay as params for SubscribeBars and request_aggregated_bars Add bar_build_delay to data engine config May 31, 2025
@faysou faysou force-pushed the bar_build_delay branch from d27bd97 to 905ec7c Compare June 1, 2025 12:39
@faysou faysou force-pushed the bar_build_delay branch from 905ec7c to 6302f00 Compare June 1, 2025 13:33
@cjdsellers cjdsellers merged commit dc53353 into develop Jun 1, 2025
17 checks passed
@cjdsellers cjdsellers deleted the bar_build_delay branch June 1, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants