Skip to content

charton API


charton API / @chart-on/core / index / resampleBars

Function: resampleBars() ​

resampleBars(bars, options): Bar[]

Defined in: packages/core/src/data/aggregate.ts:347

Build bars of a longer interval from shorter ones, e.g. 5m from 1m, or daily bars from intraday ones when the session is given. bars must be ascending; each output bar opens with its first bar, closes with its last, and sums volume and buyVolume when the bars have them. Bars outside the session are dropped. The source interval should divide the target one, and line up with its session, or bars straddle two buckets and land in the one they start in.

Parameters ​

bars ​

readonly Bar[]

options ​

BarBucketOptions

Returns ​

Bar[]