ConceptsData
These docs track the unreleased nightly build and may change without notice. Switch to the latest stable docs.
InstrumentClose
InstrumentClose represents a closing price event for an instrument at a venue. It covers
end‑of‑session closes and contract‑expiry close events.
Fields
| Field | Rust type | Python type | Required/default | Notes |
|---|---|---|---|---|
instrument_id | InstrumentId | InstrumentId | Required | Instrument being closed. |
close_price | Price | Price | Required | Closing or settlement price. |
close_type | InstrumentCloseType | InstrumentCloseType | Required | END_OF_SESSION or CONTRACT_EXPIRED. |
ts_event | UnixNanos | int | Required | Event timestamp in nanoseconds. |
ts_init | UnixNanos | int | Required | Initialization timestamp in nanoseconds. |
Behavior
- End‑of‑session closes provide session‑level close prices.
- Contract‑expiry closes mark expiration events for dated contracts.
- The close price is reference data; it does not imply a trade occurred at that price.
Example
use nautilus_core::UnixNanos;
use nautilus_model::{
data::InstrumentClose,
enums::InstrumentCloseType,
identifiers::InstrumentId,
types::Price,
};
let close = InstrumentClose::new(
InstrumentId::from("ESM4.XCME"),
Price::from("5325.25"),
InstrumentCloseType::EndOfSession,
UnixNanos::from(1_000_000_000),
UnixNanos::from(1_000_000_100),
);Related guides
- InstrumentStatus covers instrument status events.
- Instruments covers instrument definitions.
- Python API reference lists Python members.
InstrumentStatus
InstrumentStatus represents a change in an instrument's trading state. It captures venue status events such as pre‑open, trading, halt, pause, close, and...
Custom Data
Nautilus Trader supports custom data authored in Python and Rust, and moves that data through the same runtime, persistence, and query pipeline used by the...