Divergence Technical Analysis (背离技术分析) — Complete Implementation Specification

Author: Jiangnan Xiaoyin (江南小隐) Original Language: Chinese (Simplified) Market Focus: A-shares (Shanghai & Shenzhen Stock Exchanges) Trading Style: Divergence-based timing for entries and exits across all timeframes


Table of Contents

  1. Core Philosophy

  2. Fundamentals of Divergence

  3. MACD Divergence System

  4. RSI Divergence System

  5. Volume-Price Divergence

  6. Top Divergence Identification

  7. Bottom Divergence Identification

  8. Hidden Divergence

  9. Multi-Indicator Divergence Confluence

  10. Timeframe Analysis

  11. Entry Timing Using Divergence

  12. Exit Timing Using Divergence

  13. Risk Management for Divergence Trades

  14. Common Errors and Pitfalls

  15. Key Quotes and Principles


1. Core Philosophy

Jiangnan Xiaoyin's thesis is that divergence between price action and technical indicators is the single most reliable signal for trend exhaustion and reversal. While most traders use indicators as trend-following tools, divergence analysis inverts this — it uses indicators to identify when the current trend is losing internal strength, even as price continues to make new extremes.

Core principles:


2. Fundamentals of Divergence

2.1 Types of Divergence

Type Price Action Indicator Action Implication
Regular Bearish Higher high Lower high Trend exhaustion at top
Regular Bullish Lower low Higher low Trend exhaustion at bottom
Hidden Bearish Lower high Higher high Continuation of downtrend
Hidden Bullish Higher low Lower low Continuation of uptrend

2.2 Regular vs. Hidden Divergence

2.3 Divergence Strength Classification

Class Description Reliability
Class A (Strong) Clear, large divergence with significant indicator movement High (70%+)
Class B (Moderate) Visible divergence but with smaller indicator differential Moderate (55-65%)
Class C (Weak) Marginal divergence, barely visible Low (40-50%) — avoid

2.4 Requirements for Valid Divergence

  1. The two price extremes being compared must be separated by at least 10 bars
  2. The indicator must show a clear directional difference (not flat)
  3. There should be no intervening crossover of the indicator between the two extremes
  4. The divergence should be visible on the chart without zooming in or squinting

3. MACD Divergence System

The MACD (Moving Average Convergence Divergence) is the primary divergence indicator in this methodology.

3.1 MACD Components for Divergence

3.2 MACD Histogram Divergence

The histogram divergence is the earliest warning:

Bearish Histogram Divergence:
  Price makes higher high at time T2 vs T1
  MACD histogram peak at T2 < histogram peak at T1
  -> Momentum is declining despite higher prices

Bullish Histogram Divergence:
  Price makes lower low at time T2 vs T1
  MACD histogram trough at T2 > histogram trough at T1 (less negative)
  -> Selling pressure is weakening despite lower prices

3.3 MACD Line (DIF) Divergence

More significant than histogram divergence:

Bearish DIF Divergence:
  Price higher high + DIF lower high
  Especially powerful when DIF fails to cross above zero on the second peak

Bullish DIF Divergence:
  Price lower low + DIF higher low
  Especially powerful when DIF fails to cross below zero on the second trough

3.4 Zero-Line Rejection Divergence

A special form of MACD divergence:

3.5 Triple Divergence

When three consecutive price highs (or lows) show progressively weaker MACD readings:

Price: High1 < High2 < High3 (three higher highs)
MACD: Peak1 > Peak2 > Peak3 (three lower peaks)
-> Triple bearish divergence — extremely strong reversal signal

Triple divergence is rare but has the highest reliability rate (estimated 80%+ reversal probability).


4. RSI Divergence System

4.1 RSI Configuration

4.2 RSI Regular Divergence

Bearish RSI Divergence:
  Price makes higher high
  RSI makes lower high
  Most powerful when RSI was >= 70 at the first peak but < 70 at the second

Bullish RSI Divergence:
  Price makes lower low
  RSI makes higher low
  Most powerful when RSI was <= 30 at the first trough but > 30 at the second

4.3 RSI Zone Divergence

The power of RSI divergence is amplified by the zone in which it occurs:

Scenario Zone Signal Strength
Bearish divergence with RSI > 70 Overbought Strong sell signal
Bearish divergence with RSI 50-70 Neutral Moderate — wait for confirmation
Bearish divergence with RSI < 50 Oversold Weak — likely just a pause in downtrend
Bullish divergence with RSI < 30 Oversold Strong buy signal
Bullish divergence with RSI 30-50 Neutral Moderate — wait for confirmation
Bullish divergence with RSI > 50 Overbought Weak — likely just a pause in uptrend

4.4 Failure Swings with Divergence

An RSI failure swing combined with divergence is a high-probability setup:

Bullish Failure Swing:

  1. RSI drops below 30
  2. RSI bounces above 30
  3. RSI pulls back but holds above 30 (failure to return to oversold)
  4. RSI breaks above its prior bounce high
  5. If price has made a lower low during steps 1-4, divergence is confirmed

Bearish Failure Swing:

  1. RSI rises above 70
  2. RSI drops below 70
  3. RSI bounces but fails to re-enter overbought (stays below 70)
  4. RSI breaks below its prior pullback low
  5. If price has made a higher high during steps 1-4, divergence is confirmed

5. Volume-Price Divergence

5.1 Basic Volume-Price Relationships

Price Volume Interpretation
Rising Rising Healthy trend — no divergence
Rising Falling Bearish divergence — rally losing participation
Falling Rising Climax selling or distribution — watch for reversal
Falling Falling Selling exhaustion — potential bullish divergence

5.2 Volume Divergence at Tops

As price makes successive higher highs:

5.3 Volume Divergence at Bottoms

As price makes successive lower lows:

5.4 OBV Divergence

On-Balance Volume provides a cumulative measure of volume flow:

Bullish OBV Divergence:
  Price: lower low
  OBV: higher low or flat
  -> Volume is flowing into the stock even as price declines

Bearish OBV Divergence:
  Price: higher high
  OBV: lower high or flat
  -> Volume is flowing out despite rising price

6. Top Divergence Identification

6.1 The Top Divergence Checklist

A market or stock top is forming when multiple divergence signals converge:

top_score = 0

if MACD_histogram_bearish_divergence:    top_score += 2
if MACD_line_bearish_divergence:         top_score += 2
if RSI_bearish_divergence:               top_score += 2
if RSI_in_overbought_zone:              top_score += 1
if volume_price_bearish_divergence:      top_score += 2
if OBV_bearish_divergence:              top_score += 1
if triple_divergence_any_indicator:      top_score += 3

# top_score >= 6: high-probability top
# top_score 4-5: probable top — prepare to reduce
# top_score < 4: warning only — monitor

6.2 Top Divergence Timeframes

The larger the timeframe, the more significant the divergence.

6.3 Price Confirmation of Top

Divergence alone is not an exit trigger. Wait for price confirmation:


7. Bottom Divergence Identification

7.1 The Bottom Divergence Checklist

bottom_score = 0

if MACD_histogram_bullish_divergence:    bottom_score += 2
if MACD_line_bullish_divergence:         bottom_score += 2
if RSI_bullish_divergence:               bottom_score += 2
if RSI_in_oversold_zone:                bottom_score += 1
if volume_declining_into_new_lows:       bottom_score += 2
if OBV_bullish_divergence:              bottom_score += 1
if triple_divergence_any_indicator:      bottom_score += 3

# bottom_score >= 6: high-probability bottom
# bottom_score 4-5: probable bottom — prepare to buy
# bottom_score < 4: too early — continue monitoring

7.2 Price Confirmation of Bottom

7.3 The "Golden Divergence" Setup

Jiangnan Xiaoyin's highest-conviction bottom signal:

  1. Stock is in a defined downtrend (below declining 20-day and 60-day MA)
  2. Price makes a new 60-day low
  3. MACD histogram shows bullish divergence (less negative)
  4. RSI shows bullish divergence (higher low) while below 30
  5. Volume on the second low is < 60% of volume on the first low
  6. Price then forms a bullish reversal candle (hammer, engulfing, or morning star)

This "golden divergence" has the highest expected value of any setup in the book.


8. Hidden Divergence

8.1 Hidden Bullish Divergence

Occurs during pullbacks within an uptrend:

Context: Stock is in an uptrend (above rising 20-day MA)
Price: Makes a higher low (pullback within uptrend)
MACD: Makes a lower low (indicator drops further than expected)
Interpretation: Despite the deeper indicator drop, the uptrend is intact
              because price held a higher low. Trend will resume.
Entry: Buy when MACD histogram begins to turn positive again.

8.2 Hidden Bearish Divergence

Occurs during bounces within a downtrend:

Context: Stock is in a downtrend (below declining 20-day MA)
Price: Makes a lower high (bounce within downtrend)
MACD: Makes a higher high (indicator rises further than expected)
Interpretation: Despite the stronger indicator bounce, the downtrend is intact
              because price failed to make a higher high. Decline will resume.
Action: Sell or short when MACD histogram turns negative again.

8.3 Hidden vs. Regular Divergence: Decision Matrix

Market Trend Regular Divergence Hidden Divergence Action
Uptrend Bearish (at top) Bullish (at pullback) Regular = reduce/exit; Hidden = add/enter
Downtrend Bullish (at bottom) Bearish (at bounce) Regular = buy; Hidden = sell/avoid

8.4 Combining Hidden and Regular Divergence

The sequence: hidden divergence during the trend --> eventual regular divergence at the trend end. This lifecycle allows a complete trading framework:

  1. Enter on regular bullish divergence at the bottom
  2. Add on hidden bullish divergence during pullbacks within the uptrend
  3. Begin exiting on regular bearish divergence at the top
  4. Avoid buying on hidden bearish divergence during bounces within the new downtrend

9. Multi-Indicator Divergence Confluence

9.1 The Confluence Principle

A single indicator showing divergence has a base reliability of 50-60%. Each additional confirming indicator increases reliability:

Number of Confirming Indicators Estimated Reliability
1 indicator 50-60%
2 indicators 65-75%
3 indicators 75-85%
4+ indicators 85%+

9.2 Priority Ranking of Indicators

  1. MACD histogram divergence — Most sensitive, earliest signal
  2. Volume-price divergence — Confirms the supply-demand shift
  3. RSI divergence — Confirms momentum exhaustion
  4. MACD line divergence — Slower but more reliable confirmation
  5. OBV divergence — Cumulative flow confirmation

9.3 Divergence Confluence Scoring

def calculate_divergence_score(stock, date, direction):
    """Calculate confluence score for divergence signals."""
    score = 0
    signals = []

    if detect_macd_histogram_divergence(stock, date, direction):
        score += 2
        signals.append('MACD_HIST')

    if detect_macd_line_divergence(stock, date, direction):
        score += 2
        signals.append('MACD_LINE')

    if detect_rsi_divergence(stock, date, direction):
        score += 2
        signals.append('RSI')

    if detect_volume_price_divergence(stock, date, direction):
        score += 2
        signals.append('VOL_PRICE')

    if detect_obv_divergence(stock, date, direction):
        score += 1
        signals.append('OBV')

    # Bonus for triple divergence on any single indicator
    if any(detect_triple_divergence(stock, date, direction, ind)
           for ind in ['MACD', 'RSI']):
        score += 3
        signals.append('TRIPLE')

    return score, signals

10. Timeframe Analysis

10.1 Multi-Timeframe Divergence Hierarchy

Timeframe Signal Duration Use Case
15-minute Hours Intraday timing for entry/exit
60-minute 1-3 days Short-term swing timing
Daily 1-4 weeks Primary swing trading signals
Weekly 1-6 months Intermediate trend signals
Monthly 6-24 months Major cyclical turning points

10.2 Top-Down Divergence Analysis

  1. Start with the weekly chart: is there weekly divergence?
  2. If yes, move to the daily chart: is daily divergence confirming?
  3. If yes, move to the 60-minute chart: use for precise entry timing

A divergence signal on the weekly chart confirmed by the daily chart is far more powerful than a daily-only signal.

10.3 Timeframe Conflict Resolution

When different timeframes show conflicting divergence:


11. Entry Timing Using Divergence

11.1 The Divergence-Confirmation-Entry Sequence

Step 1: Detect divergence (warning phase)
Step 2: Wait for price confirmation (trigger phase)
Step 3: Enter with defined risk (execution phase)

Do NOT enter on divergence alone.
The divergence tells you the market is ready to turn.
The price confirmation tells you the turn has begun.

11.2 Price Confirmation Signals for Bullish Entry

After bullish divergence is detected:

11.3 Entry Placement

11.4 Stop Placement


12. Exit Timing Using Divergence

12.1 Using Divergence to Time Exits from Existing Positions

If you are already long and detect bearish divergence:

  1. First occurrence of bearish divergence: Tighten trailing stop but do not exit
  2. Second occurrence (double divergence): Sell 50% of position
  3. Price confirmation of top (break below swing low): Exit remaining position

12.2 Divergence-Based Trailing Stop

def divergence_trailing_stop(position, stock, date):
    """Adjust trailing stop based on divergence state."""
    bearish_div = detect_bearish_divergence(stock, date)

    if bearish_div and bearish_div.strength == 'CLASS_A':
        # Tighten stop to 5-day MA
        position.stop = max(position.stop, stock.ma5(date))
    elif bearish_div and bearish_div.strength == 'CLASS_B':
        # Tighten stop to 10-day MA
        position.stop = max(position.stop, stock.ma10(date))
    else:
        # Normal trailing at 20-day MA
        if position.gain_pct >= 0.10:
            position.stop = max(position.stop, stock.ma20(date))

    return position.stop

13. Risk Management for Divergence Trades

13.1 Position Sizing by Divergence Quality

Divergence Quality Confluence Score Position Size
Golden divergence (5+ indicators) >= 8 25-30% of capital
Strong divergence (3-4 indicators) 5-7 15-20% of capital
Moderate divergence (2 indicators) 3-4 10-15% of capital
Weak divergence (1 indicator) 1-2 No trade

13.2 Maximum Risk Per Trade

13.3 Divergence Failure Protocol

When a divergence signal fails (price continues in the original direction past the divergent extreme):

13.4 Correlation Risk


14. Common Errors and Pitfalls

14.1 Premature Entry

The most common error: entering on divergence before price confirms the reversal. Divergence can persist for many bars before the reversal actually begins. A stock can show bearish divergence and then rally another 20%.

14.2 Seeing Divergence Where None Exists

14.3 Ignoring the Trend

Bullish divergence in a strong downtrend may produce only a brief bounce, not a trend reversal. Always consider whether the divergence is powerful enough to reverse the prevailing trend, or whether it will only produce a countertrend correction.

14.4 Single-Indicator Reliance

Never trade on a single indicator's divergence. Always seek confirmation from at least one additional source (another indicator or volume).

14.5 Wrong Timeframe

A 15-minute divergence signal cannot reverse a daily downtrend. Match the timeframe of the divergence to the timeframe of your trade.


16. Key Quotes and Principles

"Divergence is the market's confession that it is lying. When price says one thing and momentum says another, believe momentum — it is harder to fake."

"Every great top and every great bottom is preceded by divergence. This is not a theory; it is a law of market physics. Momentum must fail before price can reverse."

"A single divergence is a yellow light. Two divergences across different indicators is a red light. Three divergences is a brick wall — the trend will not pass."

"The most dangerous word in a trader's vocabulary is 'early.' Divergence detected is not the same as divergence confirmed. Wait for price to agree before you act."

"Hidden divergence is the silent partner of trend-following. It tells you when the correction is a gift, not a threat. Buy the hidden bullish divergence in an uptrend; sell the hidden bearish divergence in a downtrend."

"Volume is the lie detector of the market. When price makes a new high but volume cannot match, the market is testifying under oath — and it is perjuring itself."

"Triple divergence is the market screaming. If you cannot hear three divergences across three indicators, you are not listening — you are hoping."

"The golden divergence setup — multiple indicators, extreme zones, volume confirmation — appears rarely. When it does, it is the highest-probability trade in all of technical analysis. Be ready for it."

"Never fight the timeframe hierarchy. A daily divergence cannot overpower a weekly trend. A weekly divergence cannot overpower a monthly trend. Trade with the largest timeframe, time with the smallest."


This specification synthesizes the core methodology from "背离技术分析" by Jiangnan Xiaoyin, structured as an actionable implementation guide for divergence-based trading in the A-share market.