parse_trade_bin

Function parse_trade_bin 

Source
pub fn parse_trade_bin(
    bin: BitmexTradeBin,
    instrument: &InstrumentAny,
    bar_type: &BarType,
    ts_init: UnixNanos,
) -> Result<Bar>
Expand description

Converts a BitMEX trade-bin record into a Nautilus Bar.

§Errors

Returns an error when required OHLC fields are missing from the payload.

§Panics

Panics if the bar type or price precision cannot be determined for the instrument, which indicates the instrument cache was not hydrated prior to parsing.