NautilusTrader
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

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredInstrument for the quote.
bid_pricePricePriceRequiredBest bid price.
ask_pricePricePriceRequiredBest ask price.
bid_sizeQuantityQuantityRequiredQuantity available at the best bid.
ask_sizeQuantityQuantityRequiredQuantity available at the best ask.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization 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, or MID price 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),
);

On this page