Skip to main content

parse_trade_tick

Function parse_trade_tick 

Source
pub fn parse_trade_tick(
    trade: &Trade,
    instrument: &InstrumentAny,
) -> Result<TradeTick>
Expand description

Converts a trade, taking ts_event from time_exchange and ts_init from time_coinapi.

Only exchange-reported taker sides set the aggressor; CoinAPI estimates and unknown sides become [AggressorSide::NoAggressor].

ยงErrors

Returns an error if a value is finer than the instrument precision, the size is not positive, or a timestamp or the trade identifier is invalid.