Kagi Pass Node
Kagi Chart Direction — Series Input
Overview
The Kagi Pass Node applies the Kagi chart algorithm to a series input, producing a direction signal that only changes when price reverses by the specified reversalAmount. It filters out noise below the reversal threshold, outputting a clean +1/−1 directional signal.
Kagi charts originated in Japan and eliminate time from the x-axis — only price movement matters. A "Yang" line (rising) becomes a "Yin" line (falling) only when price reverses by the reversal amount. As a Pass node, it accepts any numeric series, enabling noise-filtered directional analysis on derived data streams.
Algorithm
Parameters
| Parameter | Default | Description |
|---|---|---|
| reversalAmount | 4 | Minimum price move (in input units) required to reverse the Kagi direction |
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| input | Input | { values, timestamps } | Any numeric series (price, indicator, etc.) |
| values | Output | (number | null)[] | Kagi direction: +1 (Yang/rising) or −1 (Yin/falling) |
| timestamps | Output | number[] | Unix timestamps aligned to input |
Use Cases
Noise-Filtered Trend Direction
The Kagi output provides a binary trend direction signal that only flips when a meaningful move has occurred. Unlike a simple moving average crossover, it ignores oscillations smaller than the reversal amount — producing fewer, higher-quality direction changes.
Kagi Direction on Indicators
Apply Kagi Pass to an RSI or MACD histogram series to detect meaningful directional shifts in the indicator — filtering out the minor oscillations that frequently cause false signals in oscillator-based strategies.
Reversal Count Strategy
Count the number of times the Kagi direction has changed in the last N periods — high counts indicate a choppy market; low counts indicate a sustained trend. Use this as a regime indicator to select appropriate trading strategies.
Tips & Best Practices
Scale reversalAmount to the Series
The default reversalAmount=4 is in the units of the input series. For price data around $100, this is 4%, but for normalized indicators in [0,100] range, you may want reversalAmount=2–5. Always scale to the typical range of the input.
Use ATR for Dynamic Reversal
A fixed reversal amount may be too tight in volatile periods and too wide in quiet periods. Consider computing reversalAmount as a multiple of ATR (e.g., 1×ATR) and updating it periodically for adaptive Kagi sensitivity.
Direction Changes Are the Signal
The actual signal events are when the direction flips (−1→+1 or +1→−1), not the static direction value. Detect flips by comparing value[i] with value[i−1]. A +1 flip is the Kagi buy signal; a −1 flip is the Kagi sell signal.