NautilusTrader
ConceptsEvents
These docs track the unreleased nightly build and may change without notice. Switch to the latest stable docs.

OrderInitialized

OrderInitialized is the seed event for a new order. It carries enough information to send the order over the wire and reconstruct it with the same properties. The execution pipeline stores the order in the Cache and publishes the event on the MessageBus.

The event seeds both locally created orders and external orders materialized during reconciliation. Handler: on_order_initialized.

Fields

Beyond the common Python order event fields, OrderInitialized carries:

FieldPython typeRequired/defaultDescription
order_sideOrderSideRequiredThe order side.
order_typeOrderTypeRequiredThe order type.
quantityQuantityRequiredThe order quantity.
time_in_forceTimeInForceRequiredThe order time in force.
post_onlyboolRequiredIf the order only provides liquidity.
reduce_onlyboolRequiredIf the order carries the reduce‑only instruction.
quote_quantityboolRequiredIf quantity is denominated in the quote currency.
reconciliationboolRequiredIf the event was generated during reconciliation.
pricePrice or NoneNoneThe limit price.
activation_pricePrice or NoneNoneThe activation price for a trailing‑stop order.
trigger_pricePrice or NoneNoneThe stop trigger price.
trigger_typeTriggerType or NoneNoneThe trigger type.
limit_offsetDecimal or NoneNoneThe trailing offset for the limit price.
trailing_offsetDecimal or NoneNoneThe trailing offset for the trigger price.
trailing_offset_typeTrailingOffsetType or NoneNoneThe trailing offset type.
expire_timeint or NoneNoneThe UNIX expiration timestamp in nanoseconds.
display_qtyQuantity or NoneNoneThe quantity displayed on the public book.
emulation_triggerTriggerType or NoneNoneThe market price trigger for local emulation.
trigger_instrument_idInstrumentId or NoneNoneThe instrument that supplies the emulation trigger.
contingency_typeContingencyType or NoneNoneThe order contingency type.
order_list_idOrderListId or NoneNoneThe associated order list ID.
linked_order_idslist[ClientOrderId] or NoneNoneThe linked client order IDs.
parent_order_idClientOrderId or NoneNoneThe parent client order ID.
exec_algorithm_idExecAlgorithmId or NoneNoneThe execution algorithm ID.
exec_algorithm_paramsdict[str, str] or NoneNoneThe execution algorithm parameters.
exec_spawn_idClientOrderId or NoneNoneThe spawning primary client order ID.
tagslist[str] or NoneNoneCustom user tags.

Example

Reading the event in a strategy handler:

def on_order_initialized(self, event: OrderInitialized) -> None:
    self.log.info(
        f"Initialized {event.order_type} {event.order_side} {event.quantity} {event.instrument_id}",
    )
  • Events - Event categories, dispatch, and the common order event fields.
  • Orders - Order types and the state machine.

On this page