Orders
Provides a full range of standard order types, as well as more advanced types and order lists.
class LimitIfTouchedOrder
Bases: Order
LimitIfTouchedOrder(TraderId trader_id, StrategyId strategy_id, InstrumentId instrument_id, ClientOrderId client_order_id, OrderSide order_side, Quantity quantity, Price price, Price trigger_price, TriggerType trigger_type, UUID4 init_id, uint64_t ts_init, TimeInForce time_in_force=TimeInForce.GTC, uint64_t expire_time_ns=0, bool post_only=False, bool reduce_only=False, bool quote_quantity=False, Quantity display_qty=None, TriggerType emulation_trigger=TriggerType.NO_TRIGGER, InstrumentId trigger_instrument_id=None, ContingencyType contingency_type=ContingencyType.NO_CONTINGENCY, OrderListId order_list_id=None, list linked_order_ids=None, ClientOrderId parent_order_id=None, ExecAlgorithmId exec_algorithm_id=None, dict exec_algorithm_params=None, ClientOrderId exec_spawn_id=None, list tags=None)
Represents a Limit-If-Touched (LIT) conditional order.
A Limit-If-Touched (LIT) is an order to BUY (or SELL) an instrument at a specified price or better, below (or above) the market. This order is held in the system until the trigger price is touched. A LIT order is similar to a Stop-Limit order, except that a LIT SELL order is placed above the current market price, and a Stop-Limit SELL order is placed below.
Using a LIT order helps to ensure that, if the order does execute, the order will not execute at a price less favorable than the limit price.
- Parameters:
- trader_id (TraderId) – The trader ID associated with the order.
 - strategy_id (StrategyId) – The strategy ID associated with the order.
 - instrument_id (InstrumentId) – The order instrument ID.
 - client_order_id (ClientOrderId) – The client order ID.
 - order_side (OrderSide {
BUY,SELL}) – The order side. - quantity (Quantity) – The order quantity (> 0).
 - price (Price) – The order price (LIMIT).
 - trigger_price (Price) – The order trigger price (STOP).
 - trigger_type (TriggerType) – The order trigger type.
 - init_id (UUID4) – The order initialization event ID.
 - ts_init (uint64_t) – UNIX timestamp (nanoseconds) when the object was initialized.
 - time_in_force (TimeInForce {
GTC,IOC,FOK,GTD,DAY}, defaultGTC) – The order time in force. - expire_time_ns (uint64_t , default 0 *(*no expiry )) – UNIX timestamp (nanoseconds) when the order will expire.
 - post_only (bool , default False) – If the 
LIMITorder will only provide liquidity (once triggered). - reduce_only (bool , default False) – If the 
LIMITorder carries the ‘reduce-only’ execution instruction. - quote_quantity (bool , default False) – If the order quantity is denominated in the quote currency.
 - display_qty (Quantity , optional) – The quantity of the 
LIMITorder to display on the public book (iceberg). - emulation_trigger (TriggerType, default 
NO_TRIGGER) – The type of market price trigger to use for local order emulation.NO_TRIGGER(default): Disables local emulation; orders are sent directly to the venue.DEFAULT(the same asBID_ASK): Enables local order emulation by triggering orders based on bid/ask prices. Additional trigger types are available. See the “Emulated Orders” section in the documentation for more details.
 - trigger_instrument_id (InstrumentId , optional) – The emulation trigger instrument ID for the order (if 
Nonethen will be the instrument_id). - contingency_type (ContingencyType, default 
NO_CONTINGENCY) – The order contingency type. - order_list_id (OrderListId , optional) – The order list ID associated with the order.
 - linked_order_ids (list [ClientOrderId ] , optional) – The order linked client order ID(s).
 - parent_order_id (ClientOrderId , optional) – The order parent client order ID.
 - exec_algorithm_id (ExecAlgorithmId , optional) – The execution algorithm ID for the order.
 - exec_algorithm_params (dict *[*str , Any ] , optional) – The execution algorithm parameters for the order.
 - exec_spawn_id (ClientOrderId , optional) – The execution algorithm spawning primary client order ID.
 - tags (list *[*str ] , optional) – The custom user tags for the order.
 
 - Raises:
- ValueError – If order_side is 
NO_ORDER_SIDE. - ValueError – If quantity is not positive (> 0).
 - ValueError – If trigger_type is 
NO_TRIGGER. - ValueError – If time_in_force is 
AT_THE_OPENorAT_THE_CLOSE. - ValueError – If time_in_force is 
GTDand expire_time_ns <= UNIX epoch. - ValueError – If display_qty is negative (< 0) or greater than quantity.
 
 - ValueError – If order_side is 
 
static create(init)
display_qty
The quantity of the LIMIT order to display on the public book (iceberg).
- Returns:
Quantity or 
None 
expire_time
Return the expire time for the order (UTC).
- Return type:
datetime or 
None 
expire_time_ns
The order expiration (UNIX epoch nanoseconds), zero for no expiration.
- Returns: uint64_t
 
info(self) → str
Return a summary description of the order.
- Return type: str
 
is_triggered
If the order has been triggered.
- Returns: bool
 
price
The order price (LIMIT).
- Returns: Price
 
to_dict(self) → dict
Return a dictionary representation of this object.
- Return type: dict[str, object]
 
trigger_price
The order trigger price (STOP).
- Returns: Price
 
trigger_type
The trigger type for the order.
- Returns: TriggerType
 
ts_triggered
UNIX timestamp (nanoseconds) when the order was triggered (0 if not triggered).
- Returns: uint64_t
 
class LimitOrder
Bases: Order
LimitOrder(TraderId trader_id, StrategyId strategy_id, InstrumentId instrument_id, ClientOrderId client_order_id, OrderSide order_side, Quantity quantity, Price price, UUID4 init_id, uint64_t ts_init, TimeInForce time_in_force=TimeInForce.GTC, uint64_t expire_time_ns=0, bool post_only=False, bool reduce_only=False, bool quote_quantity=False, Quantity display_qty=None, TriggerType emulation_trigger=TriggerType.NO_TRIGGER, InstrumentId trigger_instrument_id=None, ContingencyType contingency_type=ContingencyType.NO_CONTINGENCY, OrderListId order_list_id=None, list linked_order_ids=None, ClientOrderId parent_order_id=None, ExecAlgorithmId exec_algorithm_id=None, dict exec_algorithm_params=None, ClientOrderId exec_spawn_id=None, list tags=None)
Represents a Limit order.
A Limit order is an order to BUY (or SELL) at a specified price or better. The Limit order ensures that if the order fills, it will not fill at a price less favorable than your limit price, but it does not guarantee a fill.
- A Limit-On-Open (LOO) order can be represented using a time in force of 
AT_THE_OPEN. - A Limit-On-Close (LOC) order can be represented using a time in force of 
AT_THE_CLOSE. 
- Parameters:
- trader_id (TraderId) – The trader ID associated with the order.
 - strategy_id (StrategyId) – The strategy ID associated with the order.
 - instrument_id (InstrumentId) – The order instrument ID.
 - client_order_id (ClientOrderId) – The client order ID.
 - order_side (OrderSide {
BUY,SELL}) – The order side. - quantity (Quantity) – The order quantity (> 0).
 - price (Price) – The order limit price.
 - init_id (UUID4) – The order initialization event ID.
 - ts_init (uint64_t) – UNIX timestamp (nanoseconds) when the object was initialized.
 - time_in_force (TimeInForce {
GTC,IOC,FOK,GTD,DAY,AT_THE_OPEN,AT_THE_CLOSE}, defaultGTC) – The order time in force. - expire_time_ns (uint64_t , default 0 *(*no expiry )) – UNIX timestamp (nanoseconds) when the order will expire.
 - post_only (bool , default False) – If the order will only provide liquidity (make a market).
 - reduce_only (bool , default False) – If the order carries the ‘reduce-only’ execution instruction.
 - quote_quantity (bool , default False) – If the order quantity is denominated in the quote currency.
 - display_qty (Quantity , optional) – The quantity of the order to display on the public book (iceberg).
 - emulation_trigger (TriggerType, default 
NO_TRIGGER) – The type of market price trigger to use for local order emulation.NO_TRIGGER(default): Disables local emulation; orders are sent directly to the venue.DEFAULT(the same asBID_ASK): Enables local order emulation by triggering orders based on bid/ask prices. Additional trigger types are available. See the “Emulated Orders” section in the documentation for more details.
 - trigger_instrument_id (InstrumentId , optional) – The emulation trigger instrument ID for the order (if 
Nonethen will be the instrument_id). - contingency_type (ContingencyType, default 
NO_CONTINGENCY) – The order contingency type. - order_list_id (OrderListId , optional) – The order list ID associated with the order.
 - linked_order_ids (list [ClientOrderId ] , optional) – The order linked client order ID(s).
 - parent_order_id (ClientOrderId , optional) – The order parent client order ID.
 - exec_algorithm_id (ExecAlgorithmId , optional) – The execution algorithm ID for the order.
 - exec_algorithm_params (dict *[*str , Any ] , optional) – The execution algorithm parameters for the order.
 - exec_spawn_id (ClientOrderId , optional) – The execution algorithm spawning primary client order ID.
 - tags (list *[*str ] , optional) – The custom user tags for the order.
 
 - Raises:
- ValueError – If order_side is 
NO_ORDER_SIDE. - ValueError – If quantity is not positive (> 0).
 - ValueError – If time_in_force is 
GTDand expire_time_ns <= UNIX epoch. - ValueError – If display_qty is negative (< 0) or greater than quantity.
 
 - ValueError – If order_side is 
 
static create(OrderInitialized init)
display_qty
The quantity of the order to display on the public book (iceberg).
- Returns:
Quantity or 
None 
expire_time
Return the expire time for the order (UTC).
- Return type:
datetime or 
None 
expire_time_ns
The order expiration (UNIX epoch nanoseconds), zero for no expiration.
- Returns: uint64_t
 
static from_pyo3(pyo3_order)
info(self) → str
Return a summary description of the order.
- Return type: str
 
price
The order price (LIMIT).
- Returns: Price
 
to_dict(self) → dict
Return a dictionary representation of this object.
- Return type: dict[str, object]
 
static transform_py(Order order, uint64_t ts_init, Price price=None) → LimitOrder
class MarketIfTouchedOrder
Bases: Order
MarketIfTouchedOrder(TraderId trader_id, StrategyId strategy_id, InstrumentId instrument_id, ClientOrderId client_order_id, OrderSide order_side, Quantity quantity, Price trigger_price, TriggerType trigger_type, UUID4 init_id, uint64_t ts_init, TimeInForce time_in_force=TimeInForce.GTC, uint64_t expire_time_ns=0, bool reduce_only=False, bool quote_quantity=False, TriggerType emulation_trigger=TriggerType.NO_TRIGGER, InstrumentId trigger_instrument_id=None, ContingencyType contingency_type=ContingencyType.NO_CONTINGENCY, OrderListId order_list_id=None, list linked_order_ids=None, ClientOrderId parent_order_id=None, ExecAlgorithmId exec_algorithm_id=None, dict exec_algorithm_params=None, ClientOrderId exec_spawn_id=None, list tags=None)
Represents a Market-If-Touched (MIT) conditional order.
A Market-If-Touched (MIT) is an order to BUY (or SELL) an instrument below (or above) the market. This order is held in the system until the trigger price is touched, and is then submitted as a market order. An MIT order is similar to a Stop-Order, except that an MIT SELL order is placed above the current market price, and a stop SELL order is placed below.
- Parameters:
- trader_id (TraderId) – The trader ID associated with the order.
 - strategy_id (StrategyId) – The strategy ID associated with the order.
 - instrument_id (InstrumentId) – The order instrument ID.
 - client_order_id (ClientOrderId) – The client order ID.
 - order_side (OrderSide {
BUY,SELL}) – The order side. - quantity (Quantity) – The order quantity (> 0).
 - trigger_price (Price) – The order trigger price (STOP).
 - trigger_type (TriggerType) – The order trigger type.
 - init_id (UUID4) – The order initialization event ID.
 - ts_init (uint64_t) – UNIX timestamp (nanoseconds) when the object was initialized.
 - time_in_force (TimeInForce {
GTC,IOC,FOK,GTD,DAY}, defaultGTC) – The order time in force. - expire_time_ns (uint64_t , default 0 *(*no expiry )) – UNIX timestamp (nanoseconds) when the order will expire.
 - reduce_only (bool , default False) – If the order carries the ‘reduce-only’ execution instruction.
 - quote_quantity (bool , default False) – If the order quantity is denominated in the quote currency.
 - emulation_trigger (TriggerType, default 
NO_TRIGGER) – The type of market price trigger to use for local order emulation.NO_TRIGGER(default): Disables local emulation; orders are sent directly to the venue.DEFAULT(the same asBID_ASK): Enables local order emulation by triggering orders based on bid/ask prices. Additional trigger types are available. See the “Emulated Orders” section in the documentation for more details.
 - trigger_instrument_id (InstrumentId , optional) – The emulation trigger instrument ID for the order (if 
Nonethen will be the instrument_id). - contingency_type (ContingencyType, default 
NO_CONTINGENCY) – The order contingency type. - order_list_id (OrderListId , optional) – The order list ID associated with the order.
 - linked_order_ids (list [ClientOrderId ] , optional) – The order linked client order ID(s).
 - parent_order_id (ClientOrderId , optional) – The order parent client order ID.
 - exec_algorithm_id (ExecAlgorithmId , optional) – The execution algorithm ID for the order.
 - exec_algorithm_params (dict *[*str , Any ] , optional) – The execution algorithm parameters for the order.
 - exec_spawn_id (ClientOrderId , optional) – The execution algorithm spawning primary client order ID.
 - tags (list *[*str ] , optional) – The custom user tags for the order.
 
 - Raises:
- ValueError – If order_side is 
NO_ORDER_SIDE. - ValueError – If quantity is not positive (> 0).
 - ValueError – If trigger_type is 
NO_TRIGGER. - ValueError – If time_in_force is 
AT_THE_OPENorAT_THE_CLOSE. - ValueError – If time_in_force is 
GTDand expire_time_ns <= UNIX epoch. 
 - ValueError – If order_side is 
 
static create(init)
expire_time
Return the expire time for the order (UTC).
- Return type:
datetime or 
None 
expire_time_ns
The order expiration (UNIX epoch nanoseconds), zero for no expiration.
- Returns: uint64_t
 
info(self) → str
Return a summary description of the order.
- Return type: str
 
to_dict(self) → dict
Return a dictionary representation of this object.
- Return type: dict[str, object]
 
trigger_price
The order trigger price (STOP).
- Returns: Price
 
trigger_type
The trigger type for the order.
- Returns: TriggerType
 
class MarketOrder
Bases: Order
MarketOrder(TraderId trader_id, StrategyId strategy_id, InstrumentId instrument_id, ClientOrderId client_order_id, OrderSide order_side, Quantity quantity, UUID4 init_id, uint64_t ts_init, TimeInForce time_in_force=TimeInForce.GTC, bool reduce_only=False, bool quote_quantity=False, ContingencyType contingency_type=ContingencyType.NO_CONTINGENCY, OrderListId order_list_id=None, list linked_order_ids=None, ClientOrderId parent_order_id=None, ExecAlgorithmId exec_algorithm_id=None, dict exec_algorithm_params=None, ClientOrderId exec_spawn_id=None, list tags=None)
Represents a Market order.
A Market order is an order to BUY (or SELL) at the market bid or offer price. A market order may increase the likelihood of a fill and the speed of execution, but unlike the Limit order - a Market order provides no price protection and may fill at a price far lower/higher than the top-of-book bid/ask.
- A Market-On-Open (MOO) order can be represented using a time in force of 
AT_THE_OPEN. - A Market-On-Close (MOC) order can be represented using a time in force of 
AT_THE_CLOSE. 
- Parameters:
- trader_id (TraderId) – The trader ID associated with the order.
 - strategy_id (StrategyId) – The strategy ID associated with the order.
 - instrument_id (InstrumentId) – The order instrument ID.
 - client_order_id (ClientOrderId) – The client order ID.
 - order_side (OrderSide {
BUY,SELL}) – The order side. - quantity (Quantity) – The order quantity (> 0).
 - init_id (UUID4) – The order initialization event ID.
 - ts_init (uint64_t) – UNIX timestamp (nanoseconds) when the object was initialized.
 - time_in_force (TimeInForce {
GTC,IOC,FOK,DAY,AT_THE_OPEN,AT_THE_CLOSE}, defaultGTC) – The order time in force. - reduce_only (bool , default False) – If the order carries the ‘reduce-only’ execution instruction.
 - quote_quantity (bool , default False) – If the order quantity is denominated in the quote currency.
 - contingency_type (ContingencyType, default 
NO_CONTINGENCY) – The order contingency type. - order_list_id (OrderListId , optional) – The order list ID associated with the order.
 - linked_order_ids (list [ClientOrderId ] , optional) – The order linked client order ID(s).
 - parent_order_id (ClientOrderId , optional) – The order parent client order ID.
 - exec_algorithm_id (ExecAlgorithmId , optional) – The execution algorithm ID for the order.
 - exec_algorithm_params (dict *[*str , Any ] , optional) – The execution algorithm parameters for the order.
 - exec_spawn_id (ClientOrderId , optional) – The execution algorithm spawning primary client order ID.
 - tags (list *[*str ] , optional) – The custom user tags for the order.
 
 - Raises:
- ValueError – If order_side is 
NO_ORDER_SIDE. - ValueError – If quantity is not positive (> 0).
 - ValueError – If time_in_force is 
GTD. 
 - ValueError – If order_side is 
 
static create(init)
static from_pyo3(pyo3_order)
info(self) → str
Return a summary description of the order.
- Return type: str
 
to_dict(self) → dict
Return a dictionary representation of this object.
- Return type: dict[str, object]
 
static transform_py(Order order, uint64_t ts_init) → MarketOrder
class MarketToLimitOrder
Bases: Order
MarketToLimitOrder(TraderId trader_id, StrategyId strategy_id, InstrumentId instrument_id, ClientOrderId client_order_id, OrderSide order_side, Quantity quantity, UUID4 init_id, uint64_t ts_init, TimeInForce time_in_force=TimeInForce.GTC, uint64_t expire_time_ns=0, bool reduce_only=False, bool quote_quantity=False, Quantity display_qty=None, ContingencyType contingency_type=ContingencyType.NO_CONTINGENCY, OrderListId order_list_id=None, list linked_order_ids=None, ClientOrderId parent_order_id=None, ExecAlgorithmId exec_algorithm_id=None, dict exec_algorithm_params=None, ClientOrderId exec_spawn_id=None, list tags=None)
Represents a Market-To-Limit (MTL) order.
A Market-to-Limit (MTL) order is submitted as a market order to execute at the current best market price. If the order is only partially filled, the remainder of the order is canceled and re-submitted as a Limit order with the limit price equal to the price at which the filled portion of the order executed.
- Parameters:
- trader_id (TraderId) – The trader ID associated with the order.
 - strategy_id (StrategyId) – The strategy ID associated with the order.
 - instrument_id (InstrumentId) – The order instrument ID.
 - client_order_id (ClientOrderId) – The client order ID.
 - order_side (OrderSide {
BUY,SELL}) – The order side. - quantity (Quantity) – The order quantity (> 0).
 - init_id (UUID4) – The order initialization event ID.
 - ts_init (uint64_t) – UNIX timestamp (nanoseconds) when the object was initialized.
 - time_in_force (TimeInForce {
GTC,IOC,FOK,GTD,DAY}, defaultGTC) – The order time in force. - expire_time_ns (uint64_t , default 0 *(*no expiry )) – UNIX timestamp (nanoseconds) when the order will expire.
 - reduce_only (bool , default False) – If the order carries the ‘reduce-only’ execution instruction.
 - quote_quantity (bool , default False) – If the order quantity is denominated in the quote currency.
 - display_qty (Quantity , optional) – The quantity of the limit order to display on the public book (iceberg).
 - contingency_type (ContingencyType, default 
NO_CONTINGENCY) – The order contingency type. - order_list_id (OrderListId , optional) – The order list ID associated with the order.
 - linked_order_ids (list [ClientOrderId ] , optional) – The order linked client order ID(s).
 - parent_order_id (ClientOrderId , optional) – The order parent client order ID.
 - exec_algorithm_id (ExecAlgorithmId , optional) – The execution algorithm ID for the order.
 - exec_algorithm_params (dict *[*str , Any ] , optional) – The execution algorithm parameters for the order.
 - exec_spawn_id (ClientOrderId , optional) – The execution algorithm spawning primary client order ID.
 - tags (list *[*str ] , optional) – The custom user tags for the order.
 
 - Raises:
- ValueError – If order_side is 
NO_ORDER_SIDE. - ValueError – If quantity is not positive (> 0).
 - ValueError – If time_in_force is 
AT_THE_OPENorAT_THE_CLOSE. 
 - ValueError – If order_side is 
 
static create(init)
display_qty
The quantity of the limit order to display on the public book (iceberg).
- Returns:
Quantity or 
None 
expire_time
Return the expire time for the order (UTC).
- Return type:
datetime or 
None 
expire_time_ns
The order expiration (UNIX epoch nanoseconds), zero for no expiration.
- Returns: uint64_t