Based on Lingbo (εζ³’), MACD Oscillator Indicator Upgraded Edition (ζ―θ‘ζζ MACDεηΊ§η)
Lingbo is a Chinese technical analysis author known for practical, system-oriented approaches to trading A-shares. MACD Oscillator Indicator Upgraded Edition provides a comprehensive treatment of the Moving Average Convergence Divergence indicator that goes far beyond the standard textbook description of "buy when MACD crosses above signal, sell when it crosses below."
The book treats MACD not as a standalone signal generator but as a tool for reading the momentum structure of price action. Lingbo's key contribution is systematizing MACD analysis into a hierarchy: zero-line position defines trend, histogram shape defines momentum, and signal-line crossovers define timing β with each level filtered by the one above it.
Lingbo argues MACD is particularly suited to A-share trading because:
| Dimension | Component | What It Reveals |
|---|---|---|
| Trend | MACD line position relative to zero line | Overall trend direction and strength |
| Momentum | Histogram bars (height and direction of change) | Rate of change of trend strength |
| Timing | Signal line crossovers | Entry and exit points within the trend |
The MACD indicator consists of three components derived from exponential moving averages (EMAs):
Lingbo notes that the standard parameters (12, 26, 9) work well for daily charts in A-shares. He cautions against excessive parameter optimization, which leads to curve-fitting rather than genuine improvement.
PSEUDOCODE: EMA Calculation
ββββββββββββββββββββββββββββ
function EMA(prices, period):
multiplier = 2 / (period + 1)
ema = prices[0] // Initialize with first price
for i in 1..len(prices):
ema = (prices[i] - ema) * multiplier + ema
return ema
While the default (12, 26, 9) is recommended for most purposes, Lingbo discusses specific adjustments:
The histogram is the most informative component of MACD according to Lingbo. It represents the distance between the MACD line and signal line, and its behavior reveals momentum shifts before price confirms them:
Rising histogram (bars getting taller): Momentum is accelerating in the direction of the trend. Whether above or below zero, taller bars mean the trend is strengthening.
Falling histogram (bars getting shorter): Momentum is decelerating. The trend may still continue, but its force is waning. This is the earliest warning of a potential reversal.
Histogram crossing zero: The MACD line has crossed the signal line β this is the actual crossover signal. But by reading histogram contraction beforehand, the trader is prepared.
In Chinese trading software, the histogram is typically displayed as:
Lingbo introduces the concept of histogram "mountains" (connected positive bars forming a hump) and "valleys" (connected negative bars forming a trough):
The zero line is the most important reference point in MACD analysis. When the MACD line (DIF) is above zero, the 12-period EMA is above the 26-period EMA, indicating an uptrend. Below zero indicates a downtrend.
Bullish zero-line crossover: DIF crosses above zero from below. This confirms a shift from downtrend to uptrend. Lingbo considers this one of the highest-quality MACD signals because it confirms a genuine trend change rather than a mere pullback bounce.
Bearish zero-line crossover: DIF crosses below zero from above. Confirms shift from uptrend to downtrend. When this occurs after a prolonged uptrend, it is a strong warning to exit long positions.
Bullish rejection: DIF pulls back toward zero during an uptrend but does not cross below, then turns back up. This indicates the uptrend is intact and the pullback was a buying opportunity.
Bearish rejection: DIF rallies toward zero during a downtrend but does not cross above, then turns back down. The downtrend is intact; rallies should be sold.
PSEUDOCODE: Zero-Line Analysis
ββββββββββββββββββββββββββββββββ
function analyze_zero_line(dif_series):
current = dif_series[-1]
previous = dif_series[-2]
trend = "bullish" if current > 0 else "bearish"
// Zero-line crossover
if previous < 0 and current > 0:
return "BULLISH_CROSSOVER β trend turning up"
if previous > 0 and current < 0:
return "BEARISH_CROSSOVER β trend turning down"
// Zero-line rejection (bullish)
if trend == "bullish":
recent_low = min(dif_series[-10:])
if recent_low > -0.05 * abs(max(dif_series[-30:])):
if current > previous:
return "BULLISH_REJECTION β pullback within uptrend, buying opportunity"
// Zero-line rejection (bearish)
if trend == "bearish":
recent_high = max(dif_series[-10:])
if recent_high < 0.05 * abs(min(dif_series[-30:])):
if current < previous:
return "BEARISH_REJECTION β rally within downtrend, selling opportunity"
return "NEUTRAL"
Lingbo considers divergence the most reliable and profitable signal that MACD produces. Divergence occurs when price makes a new extreme but MACD does not confirm it, indicating that momentum is failing to support the price move.
Price makes a lower low but MACD (either DIF or histogram) makes a higher low. This signals that selling pressure is diminishing and a reversal may be imminent.
Conditions for high-quality bullish divergence:
Price makes a higher high but MACD makes a lower high. Buying pressure is waning despite higher prices.
Conditions for high-quality bearish divergence:
When divergence occurs three times consecutively (price makes three higher highs with MACD making three lower highs, or vice versa), the signal is extremely strong. Lingbo considers triple divergence one of the most reliable reversal signals in technical analysis.
Hidden bullish divergence: In an uptrend, price makes a higher low but MACD makes a lower low. This signals trend continuation β the pullback is an opportunity to buy within the uptrend.
Hidden bearish divergence: In a downtrend, price makes a lower high but MACD makes a higher high. Trend continuation to the downside β rallies should be sold.
Golden cross: DIF crosses above DEA. Bullish signal. Quality depends on where it occurs relative to the zero line.
Death cross: DIF crosses below DEA. Bearish signal. Quality depends on position relative to zero line.
Lingbo ranks crossover signals by quality:
| Crossover Type | Location | Quality | Action |
|---|---|---|---|
| Golden cross | Above zero line | Highest | Strong buy β trend continuation |
| Golden cross | Near zero line (crossing up) | High | Buy β new trend beginning |
| Golden cross | Far below zero line | Medium | Potential bottom, but trend still down |
| Death cross | Below zero line | Highest | Strong sell β trend continuation down |
| Death cross | Near zero line (crossing down) | High | Sell β trend turning down |
| Death cross | Far above zero line | Medium | Pullback warning, trend may still be up |
A special pattern where DIF and DEA nearly touch (or briefly touch) but do not complete a full crossover, then diverge again in the original direction. This "kissing" pattern is a strong continuation signal: the trend tested but held.
Lingbo's multi-timeframe approach uses three levels:
The cardinal rule: never trade against the higher timeframe MACD trend.
PSEUDOCODE: Multi-Timeframe MACD Decision
βββββββββββββββββββββββββββββββββββββββββββ
weekly_macd = calculate_macd(weekly_prices)
daily_macd = calculate_macd(daily_prices)
hourly_macd = calculate_macd(hourly_prices)
// Determine weekly trend
if weekly_macd.dif > 0 and weekly_macd.histogram > previous_histogram:
weekly_trend = "STRONG_UP"
elif weekly_macd.dif > 0:
weekly_trend = "UP"
elif weekly_macd.dif < 0 and weekly_macd.histogram < previous_histogram:
weekly_trend = "STRONG_DOWN"
else:
weekly_trend = "DOWN"
// Only take long signals when weekly is UP or STRONG_UP
if weekly_trend in ["UP", "STRONG_UP"]:
if daily_macd.golden_cross() or daily_macd.bullish_divergence():
if hourly_macd.histogram_turning_up():
signal = "BUY"
confidence = "HIGH" if weekly_trend == "STRONG_UP" else "MEDIUM"
// Only take short/sell signals when weekly is DOWN or STRONG_DOWN
if weekly_trend in ["DOWN", "STRONG_DOWN"]:
if daily_macd.death_cross() or daily_macd.bearish_divergence():
signal = "SELL / AVOID"
When timeframes conflict (e.g., weekly bullish but daily bearish), Lingbo advises:
MACD signals are significantly more reliable when confirmed by volume:
A separate form of divergence exists between volume and MACD:
Lingbo recommends using moving averages (typically 20-day and 60-day) as support/resistance levels, then using MACD to time entries:
When short-term MAs are above long-term MAs (bullish alignment) and MACD is above zero with rising histogram, this represents maximum trend strength. Lingbo calls this the "triple confirmation" state β MA alignment, MACD trend, and MACD momentum all in agreement.
KDJ provides overbought/oversold readings that MACD lacks:
RSI provides momentum extremes:
Bollinger Bands provide volatility context:
Lingbo observes that MACD behaves differently across A-share market segments:
A-shares have significant auction effects. Lingbo warns that intraday MACD on timeframes shorter than 30 minutes can be distorted by the opening and closing auction mechanisms. Use 60-minute or longer for intraday MACD.
When a stock hits the daily price limit (ζΆ¨ε/θ·ε), MACD signals should be interpreted with caution:
In A-shares, sudden policy announcements can cause gap moves that invalidate MACD signals. Lingbo advises treating any gap exceeding 3% as a "reset event" that requires re-analysis of the MACD structure from scratch.
MACD performs poorly in sideways, trendless markets. The DIF and DEA repeatedly cross each other around the zero line, generating buy and sell signals that both fail. Lingbo's solution: when the histogram bars are very small and alternating rapidly, stand aside.
MACD is inherently a lagging indicator. It confirms trend changes after they have begun, not before. Divergence provides some leading quality, but even divergence requires the second peak or trough to form before it can be identified.
Not all apparent divergences lead to reversals. In very strong trends, MACD can show multiple divergences while price continues in the trend direction. Lingbo calls these "divergence traps" and advises using volume and price structure (not just MACD alone) to confirm divergence signals.
Lingbo recommends a minimum time filter between crossovers: if a golden cross is followed by a death cross within 3 bars, treat both as noise rather than genuine signals. Quality crossovers typically last at least 5-8 bars.
A golden cross that occurs below the zero line. This is a bottom-fishing signal with moderate reliability. It indicates that downward momentum is slowing, but the overall trend is still bearish. Use only as a preliminary signal β wait for zero-line crossover for full confirmation.
After a golden cross above zero, DIF pulls back to DEA (or slightly below) and then crosses up again. This second golden cross above zero is Lingbo's highest confidence buy signal: the uptrend is established, the pullback was minor, and momentum is resuming.
When the histogram forms two peaks of similar height separated by a pullback to near zero (but not crossing zero), this creates a visual "wing" pattern. This indicates strong, sustained momentum and suggests the trend will continue.
DIF briefly touches or slightly penetrates the zero line during a pullback in an uptrend, then bounces strongly back above zero. Like a trampoline effect, the brief zero-line touch provides the "spring" for the next leg up.
"MACD is not a signal machine β it is a momentum language. Learn to read it and the market will speak to you."
"The zero line is the equator of the MACD world. Above it, bulls are in control. Below it, bears dominate. The most important decisions happen at the crossing."
"Divergence is the market whispering that the trend is lying. Listen to the whisper before it becomes a scream."
"A golden cross above the zero line is worth three golden crosses below it. Position within the trend matters more than the crossover itself."
"The histogram tells you what is happening now. The DIF and DEA tell you what has happened. Only divergence hints at what will happen next."
"In a ranging market, MACD will hurt you. The first skill of a MACD trader is recognizing when not to trade."
"Multi-timeframe alignment is not optional β it is the foundation. Trading a daily golden cross against a weekly downtrend is fighting the current."
"Volume is the truth serum of any MACD signal. A crossover without volume is a promise without commitment."