ConceptsData
These docs track the unreleased nightly build and may change without notice. Switch to the latest stable docs.
QuoteTick
QuoteTick represents the top-of-book bid and ask for one instrument. It carries
the best available bid price and size, and the best available ask price and size,
at a specific event time.
Fields
| Field | Rust type | Python type | Required/default | Notes |
|---|---|---|---|---|
instrument_id | InstrumentId | InstrumentId | Required | Instrument for the quote. |
bid_price | Price | Price | Required | Best bid price. |
ask_price | Price | Price | Required | Best ask price. |
bid_size | Quantity | Quantity | Required | Quantity available at the best bid. |
ask_size | Quantity | Quantity | Required | Quantity available at the best ask. |
ts_event | UnixNanos | int | Required | Event timestamp in nanoseconds. |
ts_init | UnixNanos | int | Required | Initialization timestamp in nanoseconds. |
Behavior
- Bid and ask prices must use the same precision.
- Bid and ask sizes must use the same precision.
extract_price(PriceType.BID | ASK | MID)returns the requested price basis.- Quote bars can use
BID,ASK, orMIDprice types.
Example
use nautilus_core::UnixNanos;
use nautilus_model::{
data::QuoteTick,
identifiers::InstrumentId,
types::{Price, Quantity},
};
let quote = QuoteTick::new(
InstrumentId::from("AUD/USD.SIM"),
Price::from("0.65000"),
Price::from("0.65002"),
Quantity::from("1000000"),
Quantity::from("1200000"),
UnixNanos::from(1_000_000_000),
UnixNanos::from(1_000_000_100),
);Related guides
- OrderBookDepth10 covers fixed-depth snapshots with top levels.
- Bars and aggregation covers quote-to-bar aggregation.
- Python API Reference lists Python members.
OrderBookDepth10
OrderBookDepth10 represents a fixed-depth book update with up to 10 bid levels and 10 ask levels. It is useful when a venue publishes a self-contained depth...
TradeTick
TradeTick represents one executed trade or match event from a venue. It carries the traded price, traded size, aggressor side, and venue trade identifier.