Skip to main content

Module kagi

Module kagi 

Source
Expand description

Kagi chart transformation.

Kagi charts display price movements as a series of connected vertical lines whose thickness changes based on trend direction:

  • Thick – uptrend; price has risen above the prior shoulder, the high where the last falling line began.
  • Thin – downtrend; price has fallen below the prior waist, the low where the last rising line began.

The thickness changes at the crossing itself, so a line that crosses the shoulder or waist is drawn in two parts.

A new line segment is created whenever price reverses by at least the configured reversal_amount. Time is ignored – only price movement matters.

Use to_kagi_lines to transform a slice of Bars.

Structs§

KagiConfig
Configuration for the Kagi chart transformation.
KagiLine
A single vertical segment in a Kagi chart.

Enums§

KagiThickness
Kagi line thickness, encoding the current trend direction.

Functions§

to_kagi_lines
Transform bars into Kagi lines