Nightly docs
OrderDenied
OrderDenied records that the Nautilus system cannot submit an otherwise valid order, for example
because of a risk limit or an unsupported feature. The execution pipeline applies it to the order,
updates the Cache, and publishes it on the MessageBus.
The risk engine, execution engine, execution algorithms, and execution clients can all deny an order.
Typical transition: INITIALIZED -> DENIED. Handler: on_order_denied.
Fields
Beyond the common Python order event fields,
OrderDenied carries:
| Field | Python type | Required/default | Description |
|---|---|---|---|
reason | str | Required | The standardized denied reason code, with an optional diagnostic suffix. |
Example
Reading the event in a strategy handler:
def on_order_denied(self, event: OrderDenied) -> None:
self.log.warning(f"Order {event.client_order_id} denied: {event.reason}")Related guides
- Events - Event categories, dispatch, and the common order event fields.
- Execution - Risk checks and the pre-trade pipeline.
- Order denied reasons - The standardized code set and message forms.
- Orders - Order types and the state machine.
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...
OrderEmulated
OrderEmulated records that the OrderEmulator has taken an order under local emulation. The emulator applies the event to the order, updates the Cache, and...