Skip to content

BrokerageModelRefusedToSubmitOrderOrderResponseErrorAnalysis

QuantConnect.Lean.Engine.Results.Analysis.Analyses.BrokerageModelRefusedToSubmitOrderOrderResponseErrorAnalysis

Bases: OrderResponseErrorAnalysis

Detects brokerage-model-refused-to-submit-order errors and dispatches to per-message sub-tests to surface specific solutions.

issue

issue: str

Gets a description of the brokerage-refused-to-submit-order issue.

weight

weight: int

Gets the priority weight for this analysis.

expected_message_text

expected_message_text: List[str]

Gets the message fragment that identifies a brokerage submit-order refusal.

This codeEntityType is protected.

run

run(
    order_events: List[OrderEvent], language: Language
) -> Sequence[Analysis]

Filters order events for brokerage-refused-to-submit errors and dispatches the matched messages to each per-brokerage sub-analysis to surface specific solutions.

Parameters:

Name Type Description Default
order_events List[OrderEvent]

The order events from the backtest result.

required
language Language

The programming language the algorithm is written in.

required

Returns:

Type Description
Sequence[Analysis]

Aggregated analysis results from all sub-analyses that detected a matching message.

solutions

solutions(language: Language) -> List[str]

Returns an empty list because solutions are provided by the per-brokerage sub-analyses.

This codeEntityType is protected.

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

create_aggregated_response(
    responses: List[Analysis],
) -> Sequence[Analysis]

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.

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.