作者: 江南小隐 原著语言: 简体中文 市场聚焦: A股(上海证券交易所和深圳证券交易所) 交易风格: 基于背离的择时策略,适用于所有时间周期的进出场操作
江南小隐的核心论点是:价格走势与技术指标之间的背离是判断趋势衰竭和反转的最可靠信号。大多数交易者将指标作为趋势跟踪工具,而背离分析则反其道而行——它利用指标来识别当前趋势何时正在失去内在动力,即使价格仍在创出新的极值。
核心原则:
| 类型 | 价格走势 | 指标走势 | 含义 |
|---|---|---|---|
| 常规看跌背离 | 更高的高点 | 更低的高点 | 顶部趋势衰竭 |
| 常规看涨背离 | 更低的低点 | 更高的低点 | 底部趋势衰竭 |
| 隐藏看跌背离 | 更低的高点 | 更高的高点 | 下降趋势延续 |
| 隐藏看涨背离 | 更高的低点 | 更低的低点 | 上升趋势延续 |
| 等级 | 描述 | 可靠性 |
|---|---|---|
| A级(强) | 清晰、明显的背离,指标运动幅度大 | 高(70%+) |
| B级(中等) | 可见的背离,但指标差异较小 | 中等(55-65%) |
| C级(弱) | 边缘性背离,几乎不可见 | 低(40-50%)——应回避 |
MACD(移动平均收敛发散指标)是该方法论中的主要背离指标。
柱状图背离是最早的预警:
看跌柱状图背离:
价格在T2时刻相对T1创出更高的高点
T2时刻的MACD柱状图峰值 < T1时刻的柱状图峰值
-> 尽管价格更高,动量正在下降
看涨柱状图背离:
价格在T2时刻相对T1创出更低的低点
T2时刻的MACD柱状图谷值 > T1时刻的柱状图谷值(负值更小)
-> 尽管价格更低,卖压正在减弱
比柱状图背离更为重要:
看跌DIF背离:
价格创更高的高点 + DIF创更低的高点
当DIF在第二个峰值时未能突破零轴上方时特别强烈
看涨DIF背离:
价格创更低的低点 + DIF创更高的低点
当DIF在第二个谷值时未能跌破零轴下方时特别强烈
MACD背离的一种特殊形式:
当三个连续的价格高点(或低点)显示MACD读数逐步减弱时:
价格:高点1 < 高点2 < 高点3(三个更高的高点)
MACD:峰值1 > 峰值2 > 峰值3(三个更低的峰值)
-> 三重看跌背离——极强的反转信号
三重背离罕见但具有最高可靠率(估计80%+的反转概率)。
看跌RSI背离:
价格创更高的高点
RSI创更低的高点
当RSI在第一个峰值时>= 70但在第二个峰值时< 70时最为强烈
看涨RSI背离:
价格创更低的低点
RSI创更高的低点
当RSI在第一个谷值时<= 30但在第二个谷值时> 30时最为强烈
RSI背离的力度受其所处区域的放大:
| 场景 | 区域 | 信号强度 |
|---|---|---|
| 看跌背离且RSI > 70 | 超买 | 强烈卖出信号 |
| 看跌背离且RSI 50-70 | 中性 | 中等——等待确认 |
| 看跌背离且RSI < 50 | 超卖 | 弱——可能只是下跌趋势中的暂停 |
| 看涨背离且RSI < 30 | 超卖 | 强烈买入信号 |
| 看涨背离且RSI 30-50 | 中性 | 中等——等待确认 |
| 看涨背离且RSI > 50 | 超买 | 弱——可能只是上涨趋势中的暂停 |
RSI失败摆动结合背离是高概率的交易设置:
看涨失败摆动:
看跌失败摆动:
| 价格 | 成交量 | 解读 |
|---|---|---|
| 上涨 | 放量 | 健康趋势——无背离 |
| 上涨 | 缩量 | 看跌背离——反弹参与度下降 |
| 下跌 | 放量 | 恐慌性抛售或派发——关注反转 |
| 下跌 | 缩量 | 卖压衰竭——潜在看涨背离 |
当价格连续创出更高的高点时:
当价格连续创出更低的低点时:
能量潮(OBV)提供了成交量流向的累积衡量:
看涨OBV背离:
价格:更低的低点
OBV:更高的低点或持平
-> 即使价格下跌,资金仍在流入该股票
看跌OBV背离:
价格:更高的高点
OBV:更低的高点或持平
-> 尽管价格上涨,资金正在流出
当多个背离信号汇聚时,市场或个股的顶部正在形成:
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: 高概率顶部
# top_score 4-5: 可能顶部——准备减仓
# top_score < 4: 仅为预警——继续监控
时间周期越大,背离越重要。
仅有背离不能作为出场触发器。等待价格确认:
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: 高概率底部
# bottom_score 4-5: 可能底部——准备买入
# bottom_score < 4: 过早——继续监控
江南小隐最具确信度的底部信号:
这个"黄金背离"是书中所有设置中预期价值最高的。
出现在上升趋势中的回调阶段:
背景:股票处于上升趋势(高于上行的20日均线)
价格:创出更高的低点(上升趋势中的回调)
MACD:创出更低的低点(指标跌幅超出预期)
解读:尽管指标跌幅更深,上升趋势仍然完好,
因为价格守住了更高的低点。趋势将继续。
入场:当MACD柱状图开始转为正值时买入。
出现在下降趋势中的反弹阶段:
背景:股票处于下降趋势(低于下行的20日均线)
价格:创出更低的高点(下降趋势中的反弹)
MACD:创出更高的高点(指标涨幅超出预期)
解读:尽管指标反弹更强,下降趋势仍然完好,
因为价格未能创出更高的高点。下跌将继续。
操作:当MACD柱状图再次转为负值时卖出或做空。
| 市场趋势 | 常规背离 | 隐藏背离 | 操作 |
|---|---|---|---|
| 上升趋势 | 看跌(在顶部) | 看涨(在回调处) | 常规=减仓/出场;隐藏=加仓/入场 |
| 下降趋势 | 看涨(在底部) | 看跌(在反弹处) | 常规=买入;隐藏=卖出/回避 |
顺序:趋势中的隐藏背离 --> 趋势结束时的常规背离。这个生命周期构成了完整的交易框架:
单一指标显示背离的基础可靠性为50-60%。每增加一个确认指标,可靠性提升:
| 确认指标数量 | 估计可靠性 |
|---|---|
| 1个指标 | 50-60% |
| 2个指标 | 65-75% |
| 3个指标 | 75-85% |
| 4个以上指标 | 85%+ |
def calculate_divergence_score(stock, date, direction):
"""计算背离信号的共振评分。"""
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')
# 任何单一指标出现三重背离的加分
if any(detect_triple_divergence(stock, date, direction, ind)
for ind in ['MACD', 'RSI']):
score += 3
signals.append('TRIPLE')
return score, signals
| 时间周期 | 信号持续时间 | 适用场景 |
|---|---|---|
| 15分钟 | 数小时 | 日内进出场择时 |
| 60分钟 | 1-3天 | 短线波段择时 |
| 日线 | 1-4周 | 主要波段交易信号 |
| 周线 | 1-6个月 | 中期趋势信号 |
| 月线 | 6-24个月 | 主要周期转折点 |
周线图上的背离信号经日线图确认后,远比仅有日线信号更强大。
当不同时间周期显示相互矛盾的背离时:
步骤1:检测背离(预警阶段)
步骤2:等待价格确认(触发阶段)
步骤3:以明确的风险入场(执行阶段)
不要仅凭背离就入场。
背离告诉你市场准备转向。
价格确认告诉你转向已经开始。
在检测到看涨背离后:
如果你已经持有多头仓位并检测到看跌背离:
def divergence_trailing_stop(position, stock, date):
"""根据背离状态调整移动止损。"""
bearish_div = detect_bearish_divergence(stock, date)
if bearish_div and bearish_div.strength == 'CLASS_A':
# 收紧止损至5日均线
position.stop = max(position.stop, stock.ma5(date))
elif bearish_div and bearish_div.strength == 'CLASS_B':
# 收紧止损至10日均线
position.stop = max(position.stop, stock.ma10(date))
else:
# 正常移动止损在20日均线
if position.gain_pct >= 0.10:
position.stop = max(position.stop, stock.ma20(date))
return position.stop
| 背离质量 | 共振评分 | 仓位大小 |
|---|---|---|
| 黄金背离(5+个指标) | >= 8 | 资金的25-30% |
| 强烈背离(3-4个指标) | 5-7 | 资金的15-20% |
| 中等背离(2个指标) | 3-4 | 资金的10-15% |
| 弱背离(1个指标) | 1-2 | 不交易 |
当背离信号失效(价格在原方向上继续超过背离极值)时:
最常见的错误:在价格确认反转之前就基于背离入场。背离可以在反转实际开始之前持续很多根K线。一只股票可以显示看跌背离然后再上涨20%。
在强劲下降趋势中的看涨背离可能只产生短暂的反弹,而非趋势反转。始终要考虑背离是否足够强大来逆转当前趋势,还是只会产生逆趋势的修正。
绝不仅凭单一指标的背离进行交易。始终寻求至少一个额外来源的确认(另一个指标或成交量)。
15分钟的背离信号无法逆转日线级别的下降趋势。将背离的时间周期与你交易的时间周期相匹配。
# ============================================================
# 背离技术分析 — 完整交易系统
# ============================================================
def detect_macd_divergence(prices, macd_hist, macd_line, direction, min_bars=10):
"""检测MACD背离(柱状图和线)。"""
results = {'histogram': None, 'line': None}
if direction == 'BULLISH':
# 寻找两个最近的价格低点
lows = find_swing_lows(prices, min_separation=min_bars)
if len(lows) < 2:
return results
low1, low2 = lows[-2], lows[-1] # 较早的, 较新的
if prices[low2] < prices[low1]: # 价格创更低的低点
# 检查柱状图
hist_val1 = min(macd_hist[low1-2:low1+3])
hist_val2 = min(macd_hist[low2-2:low2+3])
if hist_val2 > hist_val1: # 柱状图创更高的低点
results['histogram'] = {
'type': 'BULLISH',
'strength': classify_strength(hist_val1, hist_val2),
'price_points': (low1, low2),
'indicator_values': (hist_val1, hist_val2)
}
# 检查MACD线
line_val1 = macd_line[low1]
line_val2 = macd_line[low2]
if line_val2 > line_val1:
results['line'] = {
'type': 'BULLISH',
'strength': classify_strength(line_val1, line_val2),
'price_points': (low1, low2),
'indicator_values': (line_val1, line_val2)
}
elif direction == 'BEARISH':
highs = find_swing_highs(prices, min_separation=min_bars)
if len(highs) < 2:
return results
high1, high2 = highs[-2], highs[-1]
if prices[high2] > prices[high1]: # 价格创更高的高点
hist_val1 = max(macd_hist[high1-2:high1+3])
hist_val2 = max(macd_hist[high2-2:high2+3])
if hist_val2 < hist_val1:
results['histogram'] = {
'type': 'BEARISH',
'strength': classify_strength(hist_val1, hist_val2),
'price_points': (high1, high2),
'indicator_values': (hist_val1, hist_val2)
}
line_val1 = macd_line[high1]
line_val2 = macd_line[high2]
if line_val2 < line_val1:
results['line'] = {
'type': 'BEARISH',
'strength': classify_strength(line_val1, line_val2),
'price_points': (high1, high2),
'indicator_values': (line_val1, line_val2)
}
return results
def detect_rsi_divergence(prices, rsi, direction, min_bars=10):
"""检测RSI背离,具有区域感知。"""
if direction == 'BULLISH':
lows = find_swing_lows(prices, min_separation=min_bars)
if len(lows) < 2:
return None
low1, low2 = lows[-2], lows[-1]
if prices[low2] < prices[low1] and rsi[low2] > rsi[low1]:
zone_bonus = 1 if rsi[low1] < 30 else 0
return {
'type': 'BULLISH',
'rsi_values': (rsi[low1], rsi[low2]),
'in_oversold': rsi[low1] < 30,
'zone_bonus': zone_bonus
}
elif direction == 'BEARISH':
highs = find_swing_highs(prices, min_separation=min_bars)
if len(highs) < 2:
return None
high1, high2 = highs[-2], highs[-1]
if prices[high2] > prices[high1] and rsi[high2] < rsi[high1]:
zone_bonus = 1 if rsi[high1] > 70 else 0
return {
'type': 'BEARISH',
'rsi_values': (rsi[high1], rsi[high2]),
'in_overbought': rsi[high1] > 70,
'zone_bonus': zone_bonus
}
return None
def detect_volume_divergence(prices, volumes, direction):
"""检测量价背离。"""
if direction == 'BEARISH':
highs = find_swing_highs(prices, min_separation=10)
if len(highs) < 2:
return None
high1, high2 = highs[-2], highs[-1]
if prices[high2] > prices[high1]:
vol_at_high1 = max(volumes[high1-2:high1+3])
vol_at_high2 = max(volumes[high2-2:high2+3])
if vol_at_high2 < vol_at_high1 * 0.70:
return {'type': 'BEARISH', 'vol_ratio': vol_at_high2 / vol_at_high1}
elif direction == 'BULLISH':
lows = find_swing_lows(prices, min_separation=10)
if len(lows) < 2:
return None
low1, low2 = lows[-2], lows[-1]
if prices[low2] < prices[low1]:
vol_at_low1 = max(volumes[low1-2:low1+3])
vol_at_low2 = max(volumes[low2-2:low2+3])
if vol_at_low2 < vol_at_low1 * 0.70:
return {'type': 'BULLISH', 'vol_ratio': vol_at_low2 / vol_at_low1}
return None
def full_divergence_scan(stock, date, direction):
"""运行所有背离检测并计算共振评分。"""
hist = stock.get_history(date, lookback=120)
macd_hist, macd_line, signal = compute_macd(hist.close)
rsi = compute_rsi(hist.close, period=14)
obv = compute_obv(hist.close, hist.volume)
score = 0
signals = []
# MACD背离
macd_div = detect_macd_divergence(hist.close, macd_hist, macd_line, direction)
if macd_div['histogram']:
score += 2
signals.append(('MACD_HIST', macd_div['histogram']['strength']))
if macd_div['line']:
score += 2
signals.append(('MACD_LINE', macd_div['line']['strength']))
# RSI背离
rsi_div = detect_rsi_divergence(hist.close, rsi, direction)
if rsi_div:
score += 2 + rsi_div['zone_bonus']
signals.append(('RSI', rsi_div))
# 量价背离
vol_div = detect_volume_divergence(hist.close, hist.volume, direction)
if vol_div:
score += 2
signals.append(('VOLUME', vol_div))
# OBV背离
obv_div = detect_obv_divergence(hist.close, obv, direction)
if obv_div:
score += 1
signals.append(('OBV', obv_div))
return {
'score': score,
'signals': signals,
'direction': direction,
'actionable': score >= 4
}
def execute_divergence_trade(scan_result, stock, date, portfolio):
"""基于背离扫描结果执行交易。"""
if not scan_result['actionable']:
return None
direction = scan_result['direction']
score = scan_result['score']
hist = stock.get_history(date, lookback=60)
# 等待价格确认
if direction == 'BULLISH':
last_candle = hist[-1]
prev_candle = hist[-2]
confirmed = False
if last_candle.close > last_candle.open * 1.03: # 强烈看涨K线
confirmed = True
if (last_candle.close > prev_candle.close and
last_candle.body > prev_candle.body and
last_candle.close > prev_candle.high): # 吞没
confirmed = True
if not confirmed:
return None # 等待确认
# 入场和止损
entry_price = last_candle.close
divergent_low = min(hist.low[-20:])
stop = divergent_low * 0.99
# 仓位管理
risk_per_share = entry_price - stop
max_risk = portfolio.capital * 0.02 # 2%组合风险
shares = int(max_risk / risk_per_share)
# 按评分确定仓位上限
if score >= 8:
max_size = 0.25
elif score >= 5:
max_size = 0.15
else:
max_size = 0.10
max_shares = int((portfolio.capital * max_size) / entry_price)
shares = min(shares, max_shares)
return Trade(
stock=stock,
direction='LONG',
entry=entry_price,
stop=stop,
shares=shares,
divergence_score=score,
signals=scan_result['signals']
)
return None
"背离是市场对自身谎言的坦白。当价格说一件事而动量说另一件事时,相信动量——它更难伪造。"
"每一个伟大的顶部和每一个伟大的底部之前都有背离。这不是理论,这是市场物理学的定律。动量必须先失效,价格才能反转。"
"单一背离是黄灯。两个不同指标的背离是红灯。三个背离是一堵砖墙——趋势将无法通过。"
"交易者词汇中最危险的词是'提前'。检测到背离并不等于背离被确认。在你行动之前,等待价格的认同。"
"隐藏背离是趋势跟踪的无声伙伴。它告诉你修正是礼物而非威胁。在上升趋势中买入隐藏看涨背离;在下降趋势中卖出隐藏看跌背离。"
"成交量是市场的测谎仪。当价格创出新高但成交量无法匹配时,市场正在宣誓作证——而它正在伪证。"
"三重背离是市场在呐喊。如果你听不到三个指标的三重背离,那你不是在倾听——你是在抱希望。"
"黄金背离设置——多个指标、极端区域、成交量确认——很少出现。当它出现时,它是所有技术分析中概率最高的交易。为此做好准备。"
"永远不要对抗时间周期层级。日线背离无法战胜周线趋势。周线背离无法战胜月线趋势。用最大的时间周期确定方向,用最小的时间周期择时。"
本规范综合了江南小隐《背离技术分析》的核心方法论,构建为A股市场基于背离交易的可执行实施指南。