Skip to content

OrderExtensions

QuantConnect.Orders.OrderExtensions

Bases: Object

Provides extension methods for the Order class and for the OrderStatus enumeration

is_closed

is_closed(status: OrderStatus) -> bool

Determines if the specified status is in a closed state.

Parameters:

Name Type Description Default
status OrderStatus

The status to check

required

Returns:

Type Description
bool

True if the status is OrderStatus.FILLED, OrderStatus.CANCELED, or OrderStatus.INVALID.

is_fill

is_fill(status: OrderStatus) -> bool

Determines if the specified status is a fill, that is, OrderStatus.FILLED order OrderStatus.PARTIALLY_FILLED

Parameters:

Name Type Description Default
status OrderStatus

The status to check

required

Returns:

Type Description
bool

True if the status is OrderStatus.FILLED or OrderStatus.PARTIALLY_FILLED, false otherwise.

is_limit_order

is_limit_order(order_type: OrderType) -> bool

Determines whether or not the specified order is a limit order

Parameters:

Name Type Description Default
order_type OrderType

The order to check

required

Returns:

Type Description
bool

True if the order is a limit order, false otherwise.

is_open

is_open(status: OrderStatus) -> bool

Determines if the specified status is in an open state.

Parameters:

Name Type Description Default
status OrderStatus

The status to check

required

Returns:

Type Description
bool

True if the status is not OrderStatus.FILLED, OrderStatus.CANCELED, or OrderStatus.INVALID.

is_stop_order

is_stop_order(order_type: OrderType) -> bool

Determines whether or not the specified order is a stop order

Parameters:

Name Type Description Default
order_type OrderType

The order to check

required

Returns:

Type Description
bool

True if the order is a stop order, false otherwise.