Skip to content

OrderResponse

QuantConnect.Orders.OrderResponse

Bases: Object

Represents a response to an OrderRequest. See OrderRequest.response property for a specific request's response value

order_id

order_id: int

Gets the order id

error_message

error_message: str

Gets the error message if the error_code does not equal OrderResponseErrorCode.NONE, otherwise gets string.Empty

error_code

Gets the error code for this response.

is_success

is_success: bool

Gets true if this response represents a successful request, false otherwise If this is an unprocessed response, IsSuccess will return false.

is_error

is_error: bool

Gets true if this response represents an error, false otherwise

is_processed

is_processed: bool

Gets true if this response has been processed, false otherwise

UNPROCESSED

UNPROCESSED: OrderResponse = ...

Gets an OrderResponse for a request that has not yet been processed

error

error(
    request: OrderRequest,
    error_code: OrderResponseErrorCode,
    error_message: str,
) -> OrderResponse

Helper method to create an error response from a request

invalid_new_status

invalid_new_status(
    request: OrderRequest, order: Order
) -> OrderResponse

Helper method to create an error response due to the "New" order status

invalid_status

invalid_status(
    request: OrderRequest, order: Order
) -> OrderResponse

Helper method to create an error response due to an invalid order status

missing_security

missing_security(
    request: SubmitOrderRequest,
) -> OrderResponse

Helper method to create an error response due to a missing security

success

success(request: OrderRequest) -> OrderResponse

Helper method to create a successful response from a request

to_string

to_string() -> str

Returns a string that represents the current object.

Returns:

Type Description
str

A string that represents the current object.

unable_to_find_order

unable_to_find_order(
    request: OrderRequest,
) -> OrderResponse

Helper method to create an error response due to a bad order id

warming_up

warming_up(request: OrderRequest) -> OrderResponse

Helper method to create an error response due to algorithm still in warmup mode

zero_quantity

zero_quantity(request: OrderRequest) -> OrderResponse

Helper method to create an error response due to a zero order quantity