TradeTick

July 28, 2026 · View on GitHub

TradeTick represents one executed trade or match event from a venue. It carries the traded price, 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),
);
from nautilus_trader.model import InstrumentId
from nautilus_trader.model import Price
from nautilus_trader.model import Quantity
from nautilus_trader.model import TradeId
from nautilus_trader.model import TradeTick
from nautilus_trader.model.enums import AggressorSide

trade = TradeTick(
    instrument_id=InstrumentId.from_str("BTCUSDT.BINANCE"),
    price=Price.from_str("65000.10"),
    size=Quantity.from_str("0.25"),
    aggressor_side=AggressorSide.BUYER,
    trade_id=TradeId("123456789"),
    ts_event=1_000_000_000,
    ts_init=1_000_000_100,
)