What is the KDJ (stochastic with a J line)?
KDJ is our stochastic oscillator. It locates the close inside the high-low range of the last 9 bars (the raw value, RSV), smooths that into a K line, smooths K into a D line, and adds a J line that exaggerates the gap between them.
The smoothing here is a running average, not a simple moving average: with the default 3, each new K is two thirds of the previous K plus one third of today's RSV, starting from 50. Level lines sit at 80 and 20.
How is the KDJ calculated?
RSV = (C − LL9) / (HH9 − LL9) × 100, K = ((3 − 1) × K[t-1] + RSV) / 3, D = ((3 − 1) × D[t-1] + K) / 3, J = 3K − 2D
The terms in the formula
- HH9 / LL9
- Highest high and lowest low of the last 9 bars (the length input).
- RSV
- Where the close sits in that range, 0 at the low and 100 at the high.
- K, D
- Smoothed lines; the 3s are the %K and %D smoothing inputs; both start at 50.
- J
- An amplified line, 3K − 2D, that can run below 0 or above 100.
How do you read the KDJ?
- K and D above 80 are commonly called overbought and below 20 oversold: the close is near the top or bottom of its recent range.
- K crossing above D shows short-term momentum turning up; crossing below shows it turning down.
- J moves first and furthest; readings beyond 100 or below 0 mark an unusually stretched close.
- In a steady uptrend K and D can hug the upper zone for a long time, which itself describes strength.
What are the limits of the KDJ?
- It reacts to the last 9 bars only, so it swings fast and produces many crosses in noisy markets.
- The 50 starting value means the first few readings depend on where the history begins.
- A flat range (high equals low) leaves RSV with no real meaning; our code divides by 1 in that case.
- J is a derived exaggeration, not a separate measurement, so it adds speed but no new information.
Where can you see it on TickerBase?
Open a live chart and add the indicator