Skip to main content

parse_trade_tick

Function parse_trade_tick 

Source
pub fn parse_trade_tick(
    instrument_id: InstrumentId,
    price: f64,
    size: f64,
    price_precision: u8,
    size_precision: u8,
    ts_event: UnixNanos,
    ts_init: UnixNanos,
    trade_id: Option<TradeId>,
) -> Result<TradeTick>
Expand description

Parse IB trade tick data into a TradeTick.

§Arguments

  • instrument_id - The instrument identifier
  • price - Trade price
  • size - Trade size
  • price_precision - Price precision for the instrument
  • size_precision - Size precision for the instrument
  • ts_event - Event timestamp
  • ts_init - Initialization timestamp
  • trade_id - Optional trade ID (will be generated if not provided)

§Errors

Returns an error if price or size conversion fails.