OrderCancelRejected
OrderCancelRejected represents a CancelOrder command 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 a cancel request.
Typical transition: PENDING_CANCEL -> previous status (for example ACCEPTED). Handler:
on_order_cancel_rejected.
Fields
Beyond the common Python order event fields,
OrderCancelRejected carries:
| Field | Python type | Required/default | Description |
|---|---|---|---|
reason | str | Required | The order cancel rejection reason. |
venue_order_id | VenueOrderId or None | None | The venue‑assigned order identifier, if known. |
account_id | AccountId or None | None | The account associated with the order, if known. |
reconciliation | bool | Required | If generated during reconciliation. |
Example
Reading the event in a strategy handler:
def on_order_cancel_rejected(self, event: OrderCancelRejected) -> None:
self.log.warning(
f"Cancel rejected for {event.client_order_id}: {event.reason}",
)Related guides
OrderModifyRejected
OrderModifyRejected records that a ModifyOrder command was rejected. The ExecutionEngine applies it to the order, updates the Cache, and publishes it on the...
OrderCanceled
OrderCanceled records a confirmed cancellation. The execution pipeline applies it to the order, updates the Cache, and publishes it on the MessageBus. It...