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

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.

Fields

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredInstrument for the trade.
pricePricePriceRequiredExecuted price.
sizeQuantityQuantityRequiredExecuted quantity.
aggressor_sideAggressorSideAggressorSideRequiredBuyer, seller, or no aggressor.
trade_idTradeIdTradeIdRequiredVenue‑assigned match ID.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization timestamp in nanoseconds.

Behavior

  • size must be positive.
  • Information-driven bars require TradeTick data because they use aggressor_side.
  • Trade bars use LAST price type.
  • trade_id should be stable for the venue event when the venue provides one.

Example

use nautilus_core::UnixNanos;
use nautilus_model::{
    data::TradeTick,
    enums::AggressorSide,
    identifiers::{InstrumentId, TradeId},
    types::{Price, Quantity},
};

let trade = TradeTick::new(
    InstrumentId::from("BTCUSDT.BINANCE"),
    Price::from("65000.10"),
    Quantity::from("0.25"),
    AggressorSide::Buyer,
    TradeId::from("123456789"),
    UnixNanos::from(1_000_000_000),
    UnixNanos::from(1_000_000_100),
);

On this page