Skip to content
EliteChart

computeRangeBars

Documentation


Documentation / @elitechart/core / computeRangeBars

code
function computeRangeBars(bars, opts?): readonly Bar[];

Defined in: series/range-bars.ts:210

Batch transform — converts an entire raw OHLCV series into Range Bars. Returns Bar[] so the existing painter pipeline consumes them unchanged. Empty input → empty output. Single-bar input → empty output (need at least 2 bars: one for seed, one for path).

The trailing in-flight range bar is NOT flushed — it stays incomplete (open without a triggered close) by convention.

Parameters

bars

readonly Bar[]

opts?

RangeBarsOptions = {}

Returns

readonly Bar[]

Example

code
import { computeRangeBars } from '@elitechart/core';
const rb = computeRangeBars(bars, { rangeSize: 50 });