Kagi Pass Node

Kagi Chart Direction — Series Input

AdvancedPrice ActionPass

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

Initialize: direction = +1, kagiHigh = series[0], kagiLow = series[0]
For each bar i:
if direction == +1:
kagiHigh = max(kagiHigh, series[i])
if series[i] <= kagiHigh − reversalAmount: direction = −1
else:
kagiLow = min(kagiLow, series[i])
if series[i] >= kagiLow + reversalAmount: direction = +1
Output[i] = direction
Output: +1 (Yang/up line) or −1 (Yin/down line). No warm-up — recursive from bar 0.

Parameters

ParameterDefaultDescription
reversalAmount4Minimum price move (in input units) required to reverse the Kagi direction

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Any numeric series (price, indicator, etc.)
valuesOutput(number | null)[]Kagi direction: +1 (Yang/rising) or −1 (Yin/falling)
timestampsOutputnumber[]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.

Related Indicators