NautilusTrader
ConceptsEvents

Nightly docs

These docs track unreleased changes and may change without notice. Their code examples can use APIs that the latest release lacks, so run them with a development wheel or switch to the latest release docs.

OrderModifyDenied

OrderModifyDenied records a local refusal of a ModifyOrder command that was not sent to its execution target. The execution pipeline applies it to the order when cached and publishes it on the MessageBus. Handler: on_order_modify_denied.

The denial preserves the working order and its terms. See Command refusals for pending-command resolution, causation, and callback migration.

Fields

Beyond the common Python order event fields, OrderModifyDenied carries:

FieldPython typeRequired/defaultDescription
reasonstrRequiredThe reason the command was denied.
venue_order_idVenueOrderId or NoneNoneThe venue-assigned order identifier, if known.
account_idAccountId or NoneNoneThe account associated with the order, if known.

Example

Reading the event in a strategy handler:

from nautilus_trader.model import OrderModifyDenied


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

On this page