MOMENTUM & OSCILLATORS

KDJ

A stochastic with a third, exaggerated line.

spec id: kdjoutputs: k · d · jlength (default 9)

What does KDJ measure?

A stochastic with a third, exaggerated line. The J line overshoots past 0 and 100, which is exactly why traders watch it for extremes.

How is KDJ calculated?

Find where the close sits between the lowest low and highest high of the last 9 candles. Smooth that twice, each time keeping two thirds of the old value — that gives `k` and `d`. `j` is three times `k` minus two times `d`.

Written by reading the engine’s real computation, not a textbook — where the two differ, the page describes what actually runs.

How do I use KDJ in a bot?

In the builder, add an indicator of type kdj (parameters: length, default 9). Its output series — k, d, j — become operands you can compare in any entry or exit rule. The engine grades the whole rule honestly: real fills, no look-ahead, half the history held back.

Related indicators

Or browse all 158 indicators in the full library.

Build a bot that trades on KDJ — the first backtest is free.

Run a free backtest