What Is KDJ? How the K and D Lines Are Calculated and Read

Where the close sits within the last nine days' high-low range, from 0 to 100. Below 20 is usually called oversold and above 80 overbought; in a strong trend it can stay high for weeks.

Contents (5 sections)
  1. How it is calculated
  2. Rules of thumb
  3. What it does not tell you
  4. In Stock Compass
  5. FAQ

KDJ is the stochastic oscillator in the form used on most Chinese and Hong Kong charts. It asks a simple question: within the range the stock has traded in over the last nine days, is the close near the top or near the bottom? The answer is a number from 0 to 100.

How it is calculated

  • RSV (raw stochastic value) for a day is the close minus the lowest low of the last nine days, divided by the highest high minus the lowest low of those nine days, times 100. A close at the nine-day high gives 100; at the nine-day low, 0.
  • K is RSV smoothed: today's K is two thirds of yesterday's K plus one third of today's RSV.
  • D is K smoothed the same way: two thirds of yesterday's D plus one third of today's K.
  • J is three times K minus two times D. It exaggerates the gap between K and D and can leave the 0 to 100 range.

K reacts first, D follows. A cross of K above D is the oscillator's version of a golden cross.

Rules of thumb

ReadingWhat it usually means
K and D below 20The close has been near the bottom of its recent range: oversold
K and D above 80The close has been near the top of its recent range: overbought
K crosses above D below 20Selling pressure easing from a low level
K crosses below D above 80Buying pressure easing from a high level

What it does not tell you

  • That an extreme will reverse. In a strong uptrend the close sits near the top of its nine-day range day after day, so K and D stay above 80 for weeks. Selling every reading above 80 means selling the strongest stocks early. The same holds below 20 in a decline.
  • Much in the middle. Between 20 and 80, crosses are frequent and mostly noise.
  • Anything beyond nine days. It is a short-term tool; it knows nothing of the trend it sits in.

In Stock Compass

Two rule indicators are available: kdj_k and kdj_d, on daily bars, with the 9-day range and the one-third smoothing described above. The J line is not offered as a condition.

Because KDJ is fast and noisy, it works better as a timing condition inside a rule that already has a trend filter, for example price above the 50-day average and kdj_k below 20, than as a rule on its own. RSI asks a similar question over 14 days and moves more slowly; Turn your logic into buy rules shows how to combine conditions.

FAQ

What is the difference between KDJ and RSI?

Both are oscillators from 0 to 100. KDJ looks at where the close sits in the last nine days' high-low range and is faster and noisier. RSI compares the size of recent gains with recent losses over 14 days and is slower. They often agree at extremes.

Is a KDJ golden cross below 20 reliable?

It is the form of the signal with the best reputation, because it combines an oversold reading with a turn. It still fails often in a falling stock, where K and D can cross several times on the way down. Test it on your own watchlist before relying on it.

Does Stock Compass have the J line?

No. The K and D values are available as rule conditions. J is three times K minus two times D, so it adds no information beyond the two lines.

Definition only — not investment advice.