Skip to main content

parse_ws_bar

Function parse_ws_bar 

Source
pub fn parse_ws_bar(
    instrument: &InstrumentAny,
    candle: &LighterWsCandle,
    resolution: LighterCandleResolution,
    ts_init: UnixNanos,
) -> Result<Bar>
Expand description

Parses a Lighter WebSocket candle into a Nautilus [Bar] with ts_event set to the bar open.

§Errors

Returns an error if the OHLCV decimals overflow the instrument’s precision, or if the timestamp cannot be converted.