Stochastic Oscillator (KD / KDJ)
Where does the close sit within the recent range? The K and D lines swing back and forth between 0 and 100.
Every lesson has an interactive simulation you can drag and play, plus a quick quiz. Sign up free to use them and save your progress automatically. Here is the text version of this lesson.
Not sure yet? Try the first lesson (no sign-up needed)「Relative Strength Index (RSI)」。
Text version · Oscillators & Momentum, lesson 2: “Stochastic Oscillator (KD / KDJ)”
Where does the close sit within the recent range? The K and D lines swing back and forth between 0 and 100.
Where does the close land in the range?
RSV measures where the close sits between the highest high and lowest low of the last N bars. KD smooths it into the K line, then smooths again to get the D line.
Golden cross low, death cross high
K crossing above D below 20 is the classic buy signal; K crossing below D above 80 is the sell signal. KDJ adds a more sensitive J line, which also gives false signals more easily.
J line: fastest, and noisiest
KDJ's J = 3K − 2D, tripling the gap between K and D, so it can shoot above 100 or below 0. It turns earliest and gives the most false signals, so it's better as a heads-up than as a reason to trade on its own.
Key takeaways
- RSV = (close − N-day low) ÷ (N-day high − N-day low) × 100: the closer the close is to the top of the range, the higher the reading.
- K is a smoothed RSV and D is a smoothed K. K > 80 is overbought; K < 20 is oversold.
- The classic signals are K crossing above D below 20 (a bullish cross at the lows) and K crossing below D above 80 (a bearish cross at the highs). Crosses in the middle mean little.
- KDJ adds a J line (J = 3K − 2D). It turns earliest and is also the most prone to false signals.
Try it yourself
You can do these exercises in this lesson's interactive simulation:
- Click "Example: close = 9-day high": what's the RSV on the ruler? Why?
- Click "Jump to a low golden cross": in which zone do the K and D lines cross? What did price do 8 bars later?
- Switch to "KDJ" and compare the number and success rate of J line signals and KD crossover signals; then switch to "Strong trend" and compare again.
- Pull N from 9 to 21: once the purple box widens, do KD's swings get calmer or wilder?
Quiz and explanations
- 1. The close is exactly equal to the highest price of the last 9 days. What's the RSV?
- Answer: 100.The close is at the very top of the range.
- 2. In the oversold zone below 20, the K line crosses above the D line. This is usually seen as…
- Answer: A buy signal.A bullish cross at the lows is the classic stochastic buy signal, though it still needs confirmation.
- 3. In a strong rally, K keeps crossing below D above 80, yet the price keeps making new highs. What's the most sensible explanation?
- Answer: In a strong trend the close keeps hugging the top of the range, so bearish crosses up high often fail.The stronger the trend, the more often the close lands near the top of the range. The stochastic sticks up high, and counter-trend crosses keep getting steamrolled.
Terms in this lesson
- false signal (False Signal): An indicator gives a signal, but price doesn't move the way it suggested.
- overbought (Overbought): An indicator reading near the top, meaning price has risen a lot recently, though it won't necessarily fall right away.
- RSV (Raw Stochastic Value): (Close − N-day low) ÷ (N-day high − N-day low) × 100.
- stochastic oscillator (Stochastic): An indicator showing where the close sits within the high-low range of the last N days (KD / KDJ).