Skip to content

QuantConnect.Orders

Classes

Class Description
AlpacaOrderProperties Provides an implementation of the OrderProperties specific to Alpaca order.
ApiOrderResponse Api order and order events reponse
BinanceOrderProperties Contains additional properties and settings for an order submitted to Binance brokerage
BitfinexOrderProperties Contains additional properties and settings for an order submitted to Bitfinex brokerage
BrokerageOrderIdChangedEvent Event used when the brokerage order id has changed
BybitOrderProperties Class containing Bybit OrderProperties
CancelOrderRequest Defines a request to cancel an order
CharlesSchwabOrderProperties Contains additional properties and settings for an order submitted to Charles Schwab brokerage
CoinbaseOrderProperties Contains additional properties and settings for an order submitted to Coinbase brokerage
ComboLegLimitOrder Combo leg limit order type
ComboLimitOrder Combo limit order type
ComboMarketOrder Combo market order type
ComboOrder Combo order type
EzeOrderProperties Contains additional properties and settings for an order submitted to EZE brokerage
FixOrderProperites FIX (Financial Information Exchange) order properties
FTXOrderProperties Contains additional properties and settings for an order submitted to FTX brokerage
GDAXOrderProperties Contains additional properties and settings for an order submitted to GDAX brokerage...
GroupOrderCacheManager Provides a thread-safe service for caching and managing original orders when they are part of a group.
GroupOrderExtensions Group (combo) orders extension methods for easiest combo order manipulation
GroupOrderManager Manager of a group of orders
IndiaOrderProperties Contains additional properties and settings for an order submitted to Indian Brokerages
InteractiveBrokersFixOrderProperties Contains additional properties and settings for an order submitted to Fix Interactive Brokers
InteractiveBrokersOrderProperties Contains additional properties and settings for an order submitted to Interactive Brokers
KrakenOrderProperties Kraken order properties
Leg Basic order leg
LimitIfTouchedOrder In effect, a LimitIfTouchedOrder behaves opposite to the StopLimitOrder;...
LimitOrder Limit order type definition
MarketOnCloseOrder Market on close order type - submits a market order on exchange close
MarketOnOpenOrder Market on Open order type, submits a market order when the exchange opens
MarketOrder Market order type definition
OptionExerciseOrder Option exercise order type definition
Order Order struct for placing new trade
OrderEvent Order Event - Messaging class signifying a change in an order state and record the change in the user's algorithm portfolio
OrderExtensions Provides extension methods for the Order class and for the OrderStatus enumeration
OrderJsonConverter Provides an implementation of JsonConverter that can deserialize Orders
OrderProperties Contains additional properties and settings for an order
OrderRequest Represents a request to submit, update, or cancel an order
OrderResponse Represents a response to an OrderRequest. See OrderRequest.response property for...
OrderSizing Provides methods for computing a maximum order size.
OrdersResponseWrapper Collection container for a list of orders for a project
OrderSubmissionData The purpose of this class is to store time and price information...
OrderTicket Provides a single reference to an order for the algorithm to maintain. As the order gets...
OrderUpdateEvent Event that fires each time an order is updated in the brokerage side....
RBIOrderProperties RBI order properties
ReadOrdersResponseJsonConverter Api orders read response json converter
StopLimitOrder Stop Market Order Type Definition
StopMarketOrder Stop Market Order Type Definition
SubmitOrderRequest Defines a request to submit a new order
TastytradeOrderProperties Contains additional properties and settings for an order submitted to Tastytrade brokerage
TDAmeritradeOrderProperties TDAmeritrade order properties
TerminalLinkOrderProperties The terminal link order properties
TimeInForce Time In Force - defines the length of time over which an order will continue working before it is canceled
TimeInForceJsonConverter Provides an implementation of JsonConverter that can deserialize TimeInForce objects
TradeStationOrderProperties Represents the properties of an order in TradeStation.
TradierOrderProperties Provides an implementation of the OrderProperties specific to Tradier order.
TradingTechnologiesOrderProperties Trading Technologies order properties
TrailingStopOrder Trailing Stop Order Type Definition
UpdateOrderFields Specifies the data in an order to be updated
UpdateOrderRequest Defines a request to update an order's values
WolverineOrderProperties Wolverine order properties

Enumerations

QuantConnect.Orders.OrderDirection

Bases: IntEnum

Direction of the order

BUY

BUY = 0

Buy Order (0)

SELL

SELL = 1

Sell Order (1)

HOLD

HOLD = 2

Default Value - No Order Direction (2)

QuantConnect.Orders.OrderError

Bases: IntEnum

Specifies the possible error states during presubmission checks

CAN_NOT_UPDATE_FILLED_ORDER

CAN_NOT_UPDATE_FILLED_ORDER = -8

Order has already been filled and cannot be modified (-8)

GENERAL_ERROR

GENERAL_ERROR = -7

General error in order (-7)

TIMESTAMP_ERROR

TIMESTAMP_ERROR = -6

Order timestamp error. Order appears to be executing in the future (-6)

MAX_ORDERS_EXCEEDED

MAX_ORDERS_EXCEEDED = -5

Exceeded maximum allowed orders for one analysis period (-5)

INSUFFICIENT_CAPITAL

INSUFFICIENT_CAPITAL = -4

Insufficient capital to execute order (-4)

MARKET_CLOSED

MARKET_CLOSED = -3

Attempting market order outside of market hours (-3)

NO_DATA

NO_DATA = -2

There is no data yet for this security - please wait for data (market order price not available yet) (-2)

ZERO_QUANTITY

ZERO_QUANTITY = -1

Order quantity must not be zero (-1)

NONE

NONE = 0

The order is OK (0)

QuantConnect.Orders.OrderField

Bases: IntEnum

Specifies an order field that does not apply to all order types

LIMIT_PRICE

LIMIT_PRICE = 0

The limit price for a LimitOrder, StopLimitOrder or LimitIfTouchedOrder (0)

STOP_PRICE

STOP_PRICE = 1

The stop price for stop orders (StopMarketOrder, StopLimitOrder) (1)

TRIGGER_PRICE

TRIGGER_PRICE = 2

The trigger price for a LimitIfTouchedOrder (2)

TRAILING_AMOUNT

TRAILING_AMOUNT = 3

The trailing amount for a TrailingStopOrder (3)

TRAILING_AS_PERCENTAGE

TRAILING_AS_PERCENTAGE = 4

Whether the trailing amount for a TrailingStopOrder is a percentage or an absolute currency value (4)

QuantConnect.Orders.OrderPosition

Bases: IntEnum

Position of the order

BUY_TO_OPEN

BUY_TO_OPEN = 0

Indicates the buy order will result in a long position, starting either from zero or an existing long position (0)

BUY_TO_CLOSE

BUY_TO_CLOSE = 1

Indicates the buy order is starting from an existing short position, resulting in a closed or long position (1)

SELL_TO_OPEN

SELL_TO_OPEN = 2

Indicates the sell order will result in a short position, starting either from zero or an existing short position (2)

SELL_TO_CLOSE

SELL_TO_CLOSE = 3

Indicates the sell order is starting from an existing long position, resulting in a closed or short position (3)

QuantConnect.Orders.OrderRequestStatus

Bases: IntEnum

Specifies the status of a request

UNPROCESSED

UNPROCESSED = 0

This is an unprocessed request (0)

PROCESSING

PROCESSING = 1

This request is partially processed (1)

PROCESSED

PROCESSED = 2

This request has been completely processed (2)

ERROR

ERROR = 3

This request encountered an error (3)

QuantConnect.Orders.OrderRequestType

Bases: IntEnum

Specifies the type of OrderRequest

SUBMIT

SUBMIT = 0

The request is a SubmitOrderRequest (0)

UPDATE

UPDATE = 1

The request is a UpdateOrderRequest (1)

CANCEL

CANCEL = 2

The request is a CancelOrderRequest (2)

QuantConnect.Orders.OrderResponseErrorCode

Bases: IntEnum

Error detail code

NONE

NONE = 0

No error (0)

PROCESSING_ERROR

PROCESSING_ERROR = -1

Unknown error (-1)

ORDER_ALREADY_EXISTS

ORDER_ALREADY_EXISTS = -2

Cannot submit because order already exists (-2)

INSUFFICIENT_BUYING_POWER

INSUFFICIENT_BUYING_POWER = -3

Not enough money to to submit order (-3)

BROKERAGE_MODEL_REFUSED_TO_SUBMIT_ORDER

BROKERAGE_MODEL_REFUSED_TO_SUBMIT_ORDER = -4

Internal logic invalidated submit order (-4)

BROKERAGE_FAILED_TO_SUBMIT_ORDER

BROKERAGE_FAILED_TO_SUBMIT_ORDER = -5

Brokerage submit error (-5)

BROKERAGE_FAILED_TO_UPDATE_ORDER

BROKERAGE_FAILED_TO_UPDATE_ORDER = -6

Brokerage update error (-6)

BROKERAGE_HANDLER_REFUSED_TO_UPDATE_ORDER

BROKERAGE_HANDLER_REFUSED_TO_UPDATE_ORDER = -7

Internal logic invalidated update order (-7)

BROKERAGE_FAILED_TO_CANCEL_ORDER

BROKERAGE_FAILED_TO_CANCEL_ORDER = -8

Brokerage cancel error (-8)

INVALID_ORDER_STATUS

INVALID_ORDER_STATUS = -9

Only pending orders can be canceled (-9)

UNABLE_TO_FIND_ORDER

UNABLE_TO_FIND_ORDER = -10

Missing order (-10)

ORDER_QUANTITY_ZERO

ORDER_QUANTITY_ZERO = -11

Cannot submit or update orders with zero quantity (-11)

UNSUPPORTED_REQUEST_TYPE

UNSUPPORTED_REQUEST_TYPE = -12

This type of request is unsupported (-12)

PRE_ORDER_CHECKS_ERROR

PRE_ORDER_CHECKS_ERROR = -13

Unknown error during pre order request validation (-13)

MISSING_SECURITY

MISSING_SECURITY = -14

Security is missing. Probably did not subscribe (-14)

EXCHANGE_NOT_OPEN

EXCHANGE_NOT_OPEN = -15

Some order types require open exchange (-15)

SECURITY_PRICE_ZERO

SECURITY_PRICE_ZERO = -16

Zero security price is probably due to bad data (-16)

FOREX_BASE_AND_QUOTE_CURRENCIES_REQUIRED

FOREX_BASE_AND_QUOTE_CURRENCIES_REQUIRED = -17

Need both currencies in cashbook to trade a pair (-17)

FOREX_CONVERSION_RATE_ZERO

FOREX_CONVERSION_RATE_ZERO = -18

Need conversion rate to account currency (-18)

SECURITY_HAS_NO_DATA

SECURITY_HAS_NO_DATA = -19

Should not attempt trading without at least one data point (-19)

EXCEEDED_MAXIMUM_ORDERS

EXCEEDED_MAXIMUM_ORDERS = -20

Transaction manager's cache is full (-20)

MARKET_ON_CLOSE_ORDER_TOO_LATE

MARKET_ON_CLOSE_ORDER_TOO_LATE = -21

Below buffer time for MOC order to be placed before exchange closes. 15.5 minutes by default (-21)

INVALID_REQUEST

INVALID_REQUEST = -22

Request is invalid or null (-22)

REQUEST_CANCELED

REQUEST_CANCELED = -23

Request was canceled by user (-23)

ALGORITHM_WARMING_UP

ALGORITHM_WARMING_UP = -24

All orders are invalidated while algorithm is warming up (-24)

BROKERAGE_MODEL_REFUSED_TO_UPDATE_ORDER

BROKERAGE_MODEL_REFUSED_TO_UPDATE_ORDER = -25

Internal logic invalidated update order (-25)

QUOTE_CURRENCY_REQUIRED

QUOTE_CURRENCY_REQUIRED = -26

Need quote currency in cashbook to trade (-26)

CONVERSION_RATE_ZERO

CONVERSION_RATE_ZERO = -27

Need conversion rate to account currency (-27)

NON_TRADABLE_SECURITY

NON_TRADABLE_SECURITY = -28

The order's symbol references a non-tradable security (-28)

NON_EXERCISABLE_SECURITY

NON_EXERCISABLE_SECURITY = -29

The order's symbol references a non-exercisable security (-29)

ORDER_QUANTITY_LESS_THAN_LOT_SIZE

ORDER_QUANTITY_LESS_THAN_LOT_SIZE = -30

Cannot submit or update orders with quantity that is less than lot size (-30)

EXCEEDS_SHORTABLE_QUANTITY

EXCEEDS_SHORTABLE_QUANTITY = -31

The order's quantity exceeds the max shortable quantity set by the brokerage (-31)

INVALID_NEW_ORDER_STATUS

INVALID_NEW_ORDER_STATUS = -32

Cannot update/cancel orders with OrderStatus.New (-32)

EUROPEAN_OPTION_NOT_EXPIRED_ON_EXERCISE

EUROPEAN_OPTION_NOT_EXPIRED_ON_EXERCISE = -33

Exercise time before expiry for European options (-33)

OPTION_ORDER_ON_STOCK_SPLIT

OPTION_ORDER_ON_STOCK_SPLIT = -34

Option order is invalid due to underlying stock split (-34)

MARKET_ON_OPEN_NOT_ALLOWED_DURING_REGULAR_HOURS

MARKET_ON_OPEN_NOT_ALLOWED_DURING_REGULAR_HOURS = -35

The Market On Open order was submitted during regular market hours, which is not allowed. This order type must be submitted before the market opens.

QuantConnect.Orders.OrderStatus

Bases: IntEnum

Fill status of the order class.

NEW

NEW = 0

New order pre-submission to the order processor (0)

SUBMITTED

SUBMITTED = 1

Order submitted to the market (1)

PARTIALLY_FILLED

PARTIALLY_FILLED = 2

Partially filled, In Market Order (2)

FILLED

FILLED = 3

Completed, Filled, In Market Order (3)

CANCELED

CANCELED = 5

Order cancelled before it was filled (5)

NONE

NONE = 6

No Order State Yet (6)

INVALID

INVALID = 7

Order invalidated before it hit the market (e.g. insufficient capital) (7)

CANCEL_PENDING

CANCEL_PENDING = 8

Order waiting for confirmation of cancellation (8)

UPDATE_SUBMITTED

UPDATE_SUBMITTED = 9

Order update submitted to the market (9)

QuantConnect.Orders.OrderType

Bases: IntEnum

Type of the order: market, limit or stop

MARKET

MARKET = 0

Market Order Type (0)

LIMIT

LIMIT = 1

Limit Order Type (1)

STOP_MARKET

STOP_MARKET = 2

Stop Market Order Type - Fill at market price when break target price (2)

STOP_LIMIT

STOP_LIMIT = 3

Stop limit order type - trigger fill once pass the stop price; but limit fill to limit price (3)

MARKET_ON_OPEN

MARKET_ON_OPEN = 4

Market on open type - executed on exchange open (4)

MARKET_ON_CLOSE

MARKET_ON_CLOSE = 5

Market on close type - executed on exchange close (5)

OPTION_EXERCISE

OPTION_EXERCISE = 6

Option Exercise Order Type (6)

LIMIT_IF_TOUCHED

LIMIT_IF_TOUCHED = 7

Limit if Touched Order Type - a limit order to be placed after first reaching a trigger value (7)

COMBO_MARKET

COMBO_MARKET = 8

Combo Market Order Type - (8)

COMBO_LIMIT

COMBO_LIMIT = 9

Combo Limit Order Type - (9)

COMBO_LEG_LIMIT

COMBO_LEG_LIMIT = 10

Combo Leg Limit Order Type - (10)

TRAILING_STOP

TRAILING_STOP = 11

Trailing Stop Order Type - (11)