Skip to content
EliteChart

computeRenkoBricks

Documentation


Documentation / @elitechart/core / computeRenkoBricks

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

Defined in: series/renko.ts:305

Batch transform — converts an entire raw OHLCV series into Renko bricks. Returns a new array of bricks shaped as Bar[] so the existing painter pipeline (legend, last-price pill) consumes them unchanged.

Empty input → empty output. Single-bar input → empty output (need at least 2 bars: one for seed, one to test the threshold).

Parameters

bars

readonly Bar[]

opts

RenkoOptions

Returns

readonly Bar[]

Example

code
import { computeRenkoBricks, suggestRenkoBrickSize } from '@elitechart/core';
const brickSize = suggestRenkoBrickSize(bars, { tickSize: 0.01 });
const renko = computeRenkoBricks(bars, { brickSize });