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

OrderInitialized

OrderInitialized represents an order having been initialized. The ExecutionEngine applies it to the order, updates the Cache, and publishes it on the MessageBus. It is the seed event that carries enough information to send an order over the wire and reconstruct it identically.

Created locally as the seed event for a new order. Handler: on_order_initialized.

Fields

Beyond the common order event fields, OrderInitialized carries:

FieldPython typeRequired/defaultDescription
sideOrderSideRequiredThe order side (exposed as event.side).
order_typeOrderTypeRequiredThe order type.
quantityQuantityRequiredThe order quantity.
time_in_forceTimeInForceRequiredThe order time in force.
post_onlyboolRequiredIf the order will only provide liquidity (make a market).
reduce_onlyboolRequiredIf the order carries the 'reduce‑only' execution instruction.
quote_quantityboolRequiredIf the order quantity is denominated in the quote currency.
optionsdict[str, str]RequiredOrder initialization options for specific order parameters.
emulation_triggerTriggerTypeNO_TRIGGERThe market price trigger for local order emulation.
trigger_instrument_idInstrumentId or NoneRequiredThe emulation trigger instrument ID (defaults to instrument_id).
contingency_typeContingencyTypeRequiredThe order contingency type.
order_list_idOrderListId or NoneRequiredThe order list ID associated with the order.
linked_order_idslist[ClientOrderId] or NoneRequiredThe linked client order ID(s).
parent_order_idClientOrderId or NoneRequiredThe order's parent client order ID.
exec_algorithm_idExecAlgorithmId or NoneRequiredThe execution algorithm ID for the order.
exec_algorithm_paramsdict[str, Any] or NoneRequiredThe execution algorithm parameters.
exec_spawn_idClientOrderId or NoneRequiredThe execution algorithm spawning primary client order ID.
tagslist[str] or NoneRequiredThe custom user tags for the order.

On this event, venue_order_id and account_id are both None, and ts_event equals ts_init. The reconciliation property always returns False here, even for orders reconstructed during reconciliation; later order events such as OrderAccepted carry the real value.

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.side} "
        f"{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