The KDJ indicator, also known as the Stochastic Oscillator, is a momentum-based technical indicator that measures the relationship between a stock’s closing price and its price range (the highest and lowest prices) over a certain period. It consists of three lines: the fast line K, the slow line D, and the dynamic line J. This tool helps traders identify overbought or oversold conditions and potential market turning points.
How the KDJ Indicator Is Calculated
Let’s break down the calculation process of the KDJ indicator step by step.
Step 1: Calculate the Raw Stochastic Value (RSV)
Formula:
RSV = (Current Close – Lowest Low in N days) / (Highest High in N days – Lowest Low in N days) × 100
Step 2: Calculate the K Line
Formula:
K_today = (2 / 3 × K_yesterday) + (1 / 3 × RSV)
Step 3: Calculate the D Line
Formula:
D_today = (2 / 3 × D_yesterday) + (1 / 3 × K_today)
Step 4: Calculate the J Line
Formula:
J_today = (3 × K_today) – (2 × D_today)
Typically, the value of N is set to 9 days.
How to Interpret the KDJ Indicator
If you’re not interested in the formulas, here’s a practical guide to using KDJ effectively:
Overbought and Oversold Conditions
- When the K line > 80 and D line > 70, the market may be overbought.
- When the K line < 20 and D line < 30, the market may be oversold.
Crossover Signals
- When the K line crosses above the D line, especially in the oversold zone, it may indicate a buy signal.
- When the K line crosses below the D line, especially in the overbought zone, it may indicate a sell signal.
J Line Sensitivity
- The J line reflects the momentum of K and D.
- A sharp rise in J may indicate a strong buy signal.
- A sharp drop in J may signal a sell-off.
Divergence
- Bearish divergence: When prices hit a new high but the KDJ lines do not, indicating potential downside.
- Bullish divergence: When prices hit a new low but the KDJ lines don’t, suggesting a potential upward reversal.
Trend Confirmation
- If K and D lines are above 50, it generally indicates an uptrend.
- If K and D lines are below 50, it generally indicates a downtrend.
Example Calculation
Assume the following data to calculate a 9-day KDJ:
- Day 9 closing price: 100
- Highest price in last 9 days: 120
- Lowest price in last 9 days: 80
- K_yesterday = 40
- D_yesterday = 30
Step 1:
RSV = (100 – 80) / (120 – 80) × 100 = 50
Step 2:
K_today = (2 / 3 × 40) + (1 / 3 × 50) = 43.33
Step 3:
D_today = (2 / 3 × 30) + (1 / 3 × 43.33) = 35.56
Step 4:
J_today = (3 × 43.33) – (2 × 35.56) = 55.49
If both K and D are rising and J is above both, the market is likely trending upwards.
Using KDJ in Combination with MACD and RSI
Like all technical indicators, KDJ may produce false signals. To reduce this risk, it’s recommended to use it alongside other indicators such as MACD and RSI.
MACD Crossovers
- Buy signal: MACD line crosses above the signal line (DEA).
- Sell signal: MACD line crosses below the signal line.
- Histogram interpretation:
- Increasing positive bars = strengthening bullish momentum
- Increasing negative bars = strengthening bearish momentum
RSI Reference Points
- RSI > 70: Overbought – price correction may follow
- RSI < 30: Oversold – rebound may occur
- RSI > 50 and rising: Market is strong
- RSI < 50 and falling: Market is weak
Integrated Trading Signals
Strong Buy Signal (when all indicators align):
- MACD line crosses above the signal line; histogram turns from negative to positive.
- RSI starts rising from below 30 or continues rising above 50.
- KDJ: K crosses above D below the 20 level (golden cross); J line spikes upward.
- Volume increases noticeably.
Strong Sell Signal:
- MACD line crosses below the signal line; histogram turns from positive to negative.
- RSI starts falling from above 70 or continues falling below 50.
- KDJ: K crosses below D above the 80 level (death cross); J line drops sharply.
- Volume increases significantly.