Skip to content
EliteChart

computeKagi

Documentation


Documentation / @elitechart/core / computeKagi

code
function computeKagi(bars, opts?): readonly KagiSegment[];

Defined in: series/kagi.ts:319

Batch transform — converts an entire raw OHLCV series into Kagi segments. Returns KagiSegment[] (extends Bar) so the existing painter pipeline consumes them unchanged.

Empty input → empty output. Single-bar input → empty output (need at least 2 closes for any direction). The trailing in-flight leg is flushed as a final segment so users see the live trend.

Parameters

bars

readonly Bar[]

opts?

KagiOptions = {}

Returns

readonly KagiSegment[]

Example

code
import { computeKagi } from '@elitechart/core';
const segments = computeKagi(bars, { reversalPercent: 4 });