parse_bars

Function parse_bars 

Source
pub fn parse_bars(
    chart_data: &DeribitTradingViewChartData,
    bar_type: BarType,
    price_precision: u8,
    size_precision: u8,
    ts_init: UnixNanos,
) -> Result<Vec<Bar>>
Expand description

Parses Deribit TradingView chart data into Nautilus [Bar]s.

Converts OHLCV arrays from the public/get_tradingview_chart_data endpoint into a vector of [Bar] objects.

§Errors

Returns an error if:

  • The status is not “ok”
  • Array lengths are inconsistent
  • No data points are present