Skip to content

charton API


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

Function: tradesToBars() ​

Call Signature ​

tradesToBars(trades, options): ActivityBar[]

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

Bars built from a batch of trades, ascending by time; see createBarBuilder. Trades may come in any order: they are sorted by time first (trades with the same time keep their order), so feeding the same trades one by one to a builder in time order gives the same bars.

Parameters ​

trades ​

readonly TradeTick[]

options ​

ActivityBarOptions

Returns ​

ActivityBar[]

Call Signature ​

tradesToBars(trades, options): Bar[]

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

Bars built from a batch of trades, ascending by time; see createBarBuilder. Trades may come in any order: they are sorted by time first (trades with the same time keep their order), so feeding the same trades one by one to a builder in time order gives the same bars.

Parameters ​

trades ​

readonly TradeTick[]

options ​

BarBucketOptions

Returns ​

Bar[]

Call Signature ​

tradesToBars(trades, options): Bar[]

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

Bars built from a batch of trades, ascending by time; see createBarBuilder. Trades may come in any order: they are sorted by time first (trades with the same time keep their order), so feeding the same trades one by one to a builder in time order gives the same bars.

Parameters ​

trades ​

readonly TradeTick[]

options ​

BarBuilderOptions

Returns ​

Bar[]