Skip to content

Run past consolidators before scheduled events#9542

Open
Kevin-Li-2025 wants to merge 1 commit into
QuantConnect:masterfrom
Kevin-Li-2025:kevin/fix-scheduled-events-after-consolidators
Open

Run past consolidators before scheduled events#9542
Kevin-Li-2025 wants to merge 1 commit into
QuantConnect:masterfrom
Kevin-Li-2025:kevin/fix-scheduled-events-after-consolidators

Conversation

@Kevin-Li-2025

Copy link
Copy Markdown

Description

Fixes #8649.

AlgorithmManager.Run currently scans past scheduled events before scanning past consolidators. When the engine catches up over a period with no data, a scheduled event can run before a due consolidator scan updates registered indicators, so the scheduled callback observes stale indicator state.

This moves the past consolidator scan ahead of ScanPastEvents while preserving the same performance tracking blocks. The added regression test runs AlgorithmManager with a single time-pulse slice and asserts that the realtime handler only scans past scheduled events after a due consolidator scan has run.

Related

Related to #5595.

Testing

DOTNET_CLI_HOME=/private/tmp/dotnet-cli-home DOTNET_ROOT=/private/tmp/dotnet10 PATH=/private/tmp/dotnet10:$PATH dotnet test Tests/QuantConnect.Tests.csproj --filter "FullyQualifiedName~ScheduledEventsRunAfterPastConsolidators" --logger "console;verbosity=minimal"

Result: passed, 1 test.

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.

The Schedule runs before the Consolidator's Callback regardless of the time

1 participant