Fix the warm-up order analysis for Python algorithms and register the MarketOnClose too-late analysis - #9657
Merged
Martin-Molinero merged 3 commits intoAug 6, 2026
Conversation
Martin-Molinero
approved these changes
Aug 6, 2026
…m-up rejection message
Martin-Molinero
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two of the backtest results analyses never produce their findings, found while manually testing the in-run analysis stream (#9632) with a Python algorithm:
AlgorithmWarmingUpOrderResponseErrorAnalysisnever matches Python algorithms. The engine formats the method names in the rejection message by algorithm language, so a Python algorithm produces:while the analysis expected the C# shape (
... Please move this code to the OnWarmupFinished() method.). The case-insensitive match absorbsinitialize, but the snake-casedon_warmup_finishedcan never containOnWarmupFinished.MessageAnalysisnow supports an optionalExpectedMessagePatternregex that takes precedence over the text fragments, for messages with variable parts fragments cannot pin down. The warm-up analysis uses it to match the full message with both method-name spellings:(OnWarmupFinished|on_warmup_finished)\(\) method\.MarketOnCloseOrderTooLateOrderResponseErrorAnalysisnever fires for any algorithm. The rejection is logged with the exact expected text, but the analysis was never registered.ResultsAnalyzer.GetAnalyses().Related Issue
N/A
Motivation and Context
These findings exist to surface order errors to the user (and LLM consumers) during and after a backtest; both were silently dead — one for every Python algorithm, the other for everyone.
Requires Documentation Change
N/A
How Has This Been Tested?
AlgorithmWarmingUpOrderResponseErrorAnalysisTests: the analysis matches both the C#- and the Python-formatted rejection message, and ignores unrelated messages.MarketOnCloseOrderTooLateOrderResponseErrorAnalysisTests: the analysis matches the too-late rejection message, and ignores unrelated messages.ResultsAnalyzerTests.DefaultAnalysisSetIncludesTheMarketOnCloseOrderTooLateAnalysis: pins the registration in the default analysis set.ResultsAnalyzerTests,ResultsAnalyzerInRunTests, the two new fixtures).Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>