NautilusTrader
ConceptsEvents

OrderRejected

OrderRejected represents an order having been rejected by the trading venue. The ExecutionEngine applies it to the order, updates the Cache, and publishes it on the MessageBus. It fires when the venue rejects the submitted order.

Transition: SUBMITTED -> REJECTED. Handler: on_order_rejected.

Fields

Beyond the common order event fields, OrderRejected carries:

FieldPython typeRequired/defaultDescription
reasonstrRequiredThe order rejected reason.
due_post_onlyboolFalseIf rejected because it was post‑only and would execute immediately as a taker.

On this event, account_id is populated, venue_order_id is None, and reconciliation carries a real value.

Example

Reading the event in a strategy handler:

def on_order_rejected(self, event: OrderRejected) -> None:
    self.log.warning(f"Order {event.client_order_id} rejected: {event.reason}")
  • Events - Event categories, dispatch, and the common order event fields.
  • Orders - Order types and the state machine.

On this page