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

OrderCanceled

OrderCanceled records a confirmed cancellation. The execution pipeline applies it to the order, updates the Cache, and publishes it on the MessageBus. It can come from a trading venue, simulated matching engine, local order emulator, or reconciliation.

Typical transition: PENDING_CANCEL / ACCEPTED -> CANCELED. Handler: on_order_canceled.

Fields

Beyond the common Python order event fields, OrderCanceled carries:

FieldPython typeRequired/defaultDescription
venue_order_idVenueOrderId or NoneNoneThe venue‑assigned order identifier, if known.
account_idAccountId or NoneNoneThe account associated with the order, if known.
reconciliationboolRequiredIf generated during reconciliation.

Example

Reading the event in a strategy handler:

def on_order_canceled(self, event: OrderCanceled) -> None:
    self.log.info(f"Order {event.client_order_id} canceled")
  • Events - Event categories, dispatch, and the common order event fields.
  • Orders - Order types and the state machine.

On this page