OrderResponseErrorAnalysis
QuantConnect.Lean.Engine.Results.Analysis.Analyses.OrderResponseErrorAnalysis
Bases: MessageAnalysis
Abstract base class for analyses that detect specific order-response errors by inspecting invalid order events for known message text fragments.
issue
issue: str
Gets a short (3–8 word) description of why the analysis was triggered.
weight
weight: int
Gets the severity/impact weight (0–100). Higher values run first and rank higher in results.
expected_message_text
expected_message_text: List[str]
This codeEntityType is protected.
run
run(
parameters: ResultsAnalysisRunParameters,
) -> Sequence[Analysis]
run(
order_events: List[OrderEvent], language: Language
) -> Sequence[Analysis]
Runs the analysis against a list of order events, extracting matching invalid-event messages and delegating to the message-based MessageAnalysis.run(IReadOnlyList{string}, Language) overload.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_events
|
Optional[List[OrderEvent]]
|
The order events from the backtest result. |
None
|
language
|
Optional[Language]
|
The programming language the algorithm is written in. |
None
|
Returns:
| Type | Description |
|---|---|
Sequence[Analysis]
|
Analysis results when any matching order response errors are found. |
get_matching_order_events_messages
get_matching_order_events_messages(
order_events: List[OrderEvent],
) -> Iterable[str]
Filters order_events to those with OrderStatus.INVALID status whose message contains all MessageAnalysis.expected_message_text fragments.
This codeEntityType is protected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_events
|
List[OrderEvent]
|
The order events to inspect. |
required |
Returns:
| Type | Description |
|---|---|
Iterable[str]
|
An enumerable of matching message strings. |
single_response
single_response(
sample: Any, solutions: Sequence[str] = None
) -> Sequence[Analysis]
single_response(
sample: Any,
count: Optional[int],
solutions: Sequence[str] = None,
) -> Sequence[Analysis]
Wraps a single QuantConnect.Analysis in a one-element read-only list.
create_aggregated_response
Filters responses to those with solutions, prefixes the class name, and returns a flat list.
This codeEntityType is protected.
format_code
format_code(code: str, language: Language) -> str
Formats the specified code string according to the conventions of the given programming language.
This codeEntityType is protected.
match
match(
messages: Sequence[str], expected_messages: List[str]
) -> Iterable[str]
Returns messages from messages that contain all strings in expected_messages (case-insensitive).
This codeEntityType is protected.