Skip to content
All library documents

Instrument Close Events and Settlement Reference Prices

Article NautilusTrader

Summary

The document defines an instrument close event as a record of a closing or settlement price associated with an instrument and venue. It distinguishes ordinary end-of-session closes from closes triggered by the expiration of a dated contract. Required data include the instrument identifier, close price, close category, event timestamp, and initialization timestamp. Rust and Python examples illustrate how to construct the record.

A key practical distinction is that the recorded close price is reference data; it does not assert that a transaction took place at that price. This matters when interpreting market data, building event-driven systems, or aligning prices with trades and orders. The page documents a data model and its fields rather than a trading method or evidence about strategy performance. It does not explain venue-specific settlement procedures, timestamp conventions beyond nanosecond units, or how downstream systems should handle corrections and missing close events.

Key ideas

  • An instrument close record can represent either a session close or a contract-expiry close.
  • The record includes an instrument, price, close category, event time, and initialization time.
  • A close price is a reference value and does not establish that a trade occurred at that price.
  • The document specifies a data structure but does not describe settlement rules or trading performance.

Tags

Full text
# InstrumentClose


# 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

```rust tab="Rust"
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),
);
```

```python tab="Python"
from nautilus_trader.model import InstrumentClose
from nautilus_trader.model import InstrumentCloseType
from nautilus_trader.model import InstrumentId
from nautilus_trader.model import Price

close = InstrumentClose(
    instrument_id=InstrumentId.from_str("ESM4.XCME"),
    close_price=Price.from_str("5325.25"),
    close_type=InstrumentCloseType.END_OF_SESSION,
    ts_event=1_000_000_000,
    ts_init=1_000_000_100,
)
```

## Related guides

- [InstrumentStatus](instrument_status.md) covers instrument status events.
- [Instruments](../instruments/) covers instrument definitions.
- [Python API reference](/docs/python-api-latest/model/data.html) lists Python members.

Shown in full with attribution under the source's licence. Licence: LGPL-3.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.