InstrumentStatus

July 28, 2026 · View on GitHub

InstrumentStatus represents a change in an instrument's trading state. It captures venue status events such as pre‑open, trading, halt, pause, close, and short‑selling restriction changes.

Fields

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredInstrument whose status changed.
actionMarketStatusActionMarketStatusActionRequiredVenue status action.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization timestamp in nanoseconds.
reasonOption<Ustr>str | NoneNoneCause of the status change when provided.
trading_eventOption<Ustr>str | NoneNoneVenue event label when provided.
is_tradingOption<bool>bool | NoneNoneWhether trading is enabled when known.
is_quotingOption<bool>bool | NoneNoneWhether quoting is enabled when known.
is_short_sell_restrictedOption<bool>bool | NoneNoneShort‑sell restriction state when known.

Behavior

  • Optional booleans allow adapters to preserve venue‑provided state without guessing.
  • action gives the normalized high‑level status even when venue‑specific details are also stored in reason or trading_event.
  • Strategies can handle status updates through on_instrument_status(...).

Example

use nautilus_core::UnixNanos;
use nautilus_model::{
    data::InstrumentStatus,
    enums::MarketStatusAction,
    identifiers::InstrumentId,
};
use ustr::Ustr;

let status = InstrumentStatus::new(
    InstrumentId::from("AAPL.XNAS"),
    MarketStatusAction::Trading,
    UnixNanos::from(1_000_000_000),
    UnixNanos::from(1_000_000_100),
    Some(Ustr::from("Normal trading")),
    Some(Ustr::from("MARKET_OPEN")),
    Some(true),
    Some(true),
    Some(false),
);
from nautilus_trader.model import InstrumentId
from nautilus_trader.model import InstrumentStatus
from nautilus_trader.model.enums import MarketStatusAction

status = InstrumentStatus(
    instrument_id=InstrumentId.from_str("AAPL.XNAS"),
    action=MarketStatusAction.TRADING,
    ts_event=1_000_000_000,
    ts_init=1_000_000_100,
    reason="Normal trading",
    trading_event="MARKET_OPEN",
    is_trading=True,
    is_quoting=True,
    is_short_sell_restricted=False,
)