NautilusTrader
ConceptsData
These docs track the unreleased nightly build and may change without notice. Switch to the latest stable docs.

InstrumentStatus

InstrumentStatus represents a change in the trading state of an instrument. 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),
);

On this page