Skip to content

charton API


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

Function: createBarBuilder() ​

Call Signature ​

createBarBuilder(options): BarBuilder<ActivityBar>

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

Turn a trade stream into bars, for sources that stream trades rather than bars. With { interval }, each trade updates the bar of its period or starts the next one; the open and close are the prices of the earliest and latest trades by time, so trades arriving slightly out of order within a bar keep the right open and close. Bars with no trades are skipped, not filled. With { ticks } or { volume }, trades fill bars in the order they arrive (see ActivityBarOptions).

Parameters ​

options ​

ActivityBarOptions

Returns ​

BarBuilder<ActivityBar>

Call Signature ​

createBarBuilder(options): BarBuilder

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

Turn a trade stream into bars, for sources that stream trades rather than bars. With { interval }, each trade updates the bar of its period or starts the next one; the open and close are the prices of the earliest and latest trades by time, so trades arriving slightly out of order within a bar keep the right open and close. Bars with no trades are skipped, not filled. With { ticks } or { volume }, trades fill bars in the order they arrive (see ActivityBarOptions).

Parameters ​

options ​

BarBucketOptions

Returns ​

BarBuilder

Call Signature ​

createBarBuilder(options): BarBuilder<ActivityBar> | BarBuilder<Bar>

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

Turn a trade stream into bars, for sources that stream trades rather than bars. With { interval }, each trade updates the bar of its period or starts the next one; the open and close are the prices of the earliest and latest trades by time, so trades arriving slightly out of order within a bar keep the right open and close. Bars with no trades are skipped, not filled. With { ticks } or { volume }, trades fill bars in the order they arrive (see ActivityBarOptions).

Parameters ​

options ​

BarBuilderOptions

Returns ​

BarBuilder<ActivityBar> | BarBuilder<Bar>