Skip to content

Documentation / @finchart/indicators / kagiSeries

Function: kagiSeries() ​

kagiSeries(options?): Series<KagiPoint>

Defined in: indicators/src/kagi-series.ts:77

Draws kagi's points as one stepped line at two widths. Between two vertices the line runs horizontally to the new x at the old price, then vertically to the new price — the corner is (new x, old y), the same rule as the step line's (a straight diagonal would draw prices the line never held). A vertical stroke is yang (thick, --chart-kagi-up-width) or yin (thin) by its point's tone, and where the point carries a breakY the stroke splits there: the tone that was standing runs up to the shoulder or waist, the new one from it. The horizontal join carries the tone standing when it was drawn. Same-tone strokes are one drawLine, so a frame costs as many lines as the tone changes plus one.

Decimation is M4 at four points per pixel, declared: every vertex is a local extreme, so a strategy that keeps every nth would drop turns, while M4 keeps a pixel column's first, lowest, highest and last as the points they are, tone and breakY intact (four per column is what makes a column one bucket). A tone change at a vertex that is none of a column's four is still lost with that vertex — a run that begins and ends inside one pixel column can vanish, the same known limit as a toned histogram bar's colour.

Parameters ​

options? ​

KagiSeriesOptions = {}

Returns ​

Series<KagiPoint>