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
| Field | Rust type | Python type | Required/default | Notes |
|---|---|---|---|---|
instrument_id | InstrumentId | InstrumentId | Required | Instrument for the trade. |
price | Price | Price | Required | Executed price. |
size | Quantity | Quantity | Required | Executed quantity. |
aggressor_side | AggressorSide | AggressorSide | Required | Buyer, seller, or no aggressor. |
trade_id | TradeId | TradeId | Required | Venue‑assigned match ID. |
ts_event | UnixNanos | int | Required | Event timestamp in nanoseconds. |
ts_init | UnixNanos | int | Required | Initialization timestamp in nanoseconds. |
Behavior
sizemust be positive.- Information-driven bars require
TradeTickdata because they useaggressor_side. - Trade bars use
LASTprice type. trade_idshould 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),
);Related guides
- Bar covers trade-to-bar aggregation.
- Information-driven bars explains aggressor-side use.
- Python API Reference lists Python members.
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...
Bar
Bar represents OHLCV price and volume data for a specific BarType. Bars can be provided externally by a venue or data provider, aggregated internally from...