hoodkit
    Preparing search index...

    Function buildCandles

    • Build OHLCV candles from raw trades. Trades are bucketed by floor(ts / intervalSec) * intervalSec; each bucket's open/close are the first/last trade by time order, high/low the extremes, volume the sum.

      Input need not be pre-sorted — it is sorted by ts internally. Buckets with no trades are omitted (sparse series); call fillGaps to forward-fill.

      Parameters

      • trades: readonly TradePoint[]
      • intervalSec: number

      Returns Candle[]