Skip to content

Function: resampleOhlc()

ts
function resampleOhlc(
   time, 
   ohlc, 
   bucketMs, 
   volume?): ResampledOhlc;

Defined in: finance/transforms.ts:240

Roll bars up to a coarser timeframe — 1m candles into 1h, daily into weekly. Buckets are aligned to multiples of bucketMs from the epoch, so the same input always produces the same boundaries. Empty buckets are skipped rather than filled, which is what a market calendar wants.

Parameters

ParameterType
timeArrayLike<number>
ohlcOhlc
bucketMsnumber
volume?ArrayLike<number>

Returns

ResampledOhlc

MIT licensed. WebGL2 required.