Bearish MACD histogram divergence as a leading indicator
A smaller positive histogram bar means the gap between MACD and its signal line has narrowed. Price can still rise. Calling that change leading only makes sense after naming the event it is supposed to precede: a signal-line crossover, a price break or a profitable trade. Those are different outcomes.
With the 12/26/9 EMA settings used here, MACD = EMA(12) − EMA(26), signal = EMA(9) of MACD, and histogram = MACD − signal. TradingView explains these separate series in its MACD indicator documentation.
Contraction, peak divergence and zero crossings
| Observation | What it establishes | What it leaves open |
|---|---|---|
| Positive histogram bars become shorter | MACD is closer to its signal line. | No second price peak or confirmed reversal is required. |
| Higher price peak, lower histogram peak | A price versus histogram bearish divergence under a stated pivot rule. | Price may keep rising; MACD line peaks need not diverge. |
| Histogram crosses below zero | MACD has crossed below its signal line. | MACD itself can remain above zero. |
| MACD line crosses below zero | The fast EMA has moved below the slow EMA. | This is a different event from histogram crossing zero. |
Specify the comparison series. StockCharts also describes divergence between the MACD line and its histogram, including distinct peaks and sloping contraction. Its MACD-Histogram guide discusses anticipating signal-line crossovers. That definition should not silently replace a price versus histogram rule.
An illustrative bearish divergence and its timing
Suppose two confirmed closing-price peaks are $100 and $104, while their paired positive histogram peaks are 0.80 and 0.50. The second price peak is higher and the second histogram peak is lower. That meets a price versus histogram bearish-divergence rule. These are hypothetical values, not scanner results or a historical trade.
A five-right-bar pivot cannot be known at its peak. If price peaks on bar 50, it needs bars 51 through 55 before confirmation. If the paired oscillator peak is on bar 52, the pair is not confirmed until bar 57. Use the later confirmation time when testing an entry. A marker drawn back at bar 50 does not mean the signal was available then. TradingView documents this risk under repainting and plotting in the past.
For bullish divergence, reverse the comparison: price makes a lower low while the selected oscillator makes a higher low. Use the same price source, oscillator, pivot window and pairing rule for both directions. Switching from closes to candle highs or lows changes which pivots qualify.
What this scanner actually checks
- It requests roughly 180 calendar days of daily history and requires at least 50 records. EMA calculations start with an SMA seed. Feed, adjustment and warm-up differences can produce values that differ from a TradingView chart.
- Detection compares closing-price pivots with the MACD line. Each strict peak or trough must exceed or fall below all five neighbors on each side. Equal highs or lows do not qualify.
- It considers adjacent pairs among the last three price pivots and finds the first MACD pivot within five bars from each, using the last three MACD pivots. It does not search every possible pair or enforce same-sign oscillator peaks.
- Peak comparisons run before trough comparisons, and the first match is returned for each symbol. Results therefore are not a complete signal history or necessarily the most recent divergence.
- Regular bearish divergence means a higher closing-price high and lower MACD high. Regular bullish divergence means a lower closing-price low and higher MACD low. Hidden labels use the opposite comparisons; no independent trend filter confirms continuation.
The table and CSV show the second price pivot date. Confirmation needs five later bars after both matched pivots; a current daily record may still change before the session closes. Review the chart and data timestamp before treating any match as final.
When the reversal idea fails
A trend can slow and then accelerate again. In the hypothetical bearish example, price might move above $104 while the histogram expands to a new peak. A lower histogram peak alone gives neither an entry price nor a maximum loss. Define a separate price trigger, a time limit for the setup and an invalidation level before testing it. The scanner does not implement those trade rules.
Test all qualifying signals from their confirmation dates, with the same holding period, fees and slippage. Compare the distribution of subsequent returns, adverse moves and drawdowns with a stated baseline. Keep a later period out of rule selection. Selected screenshots cannot establish that divergence adds predictive value.
The strength label is only a local formula: regular divergence is strong when the price change exceeds 3% and the MACD change exceeds 20% of the first MACD pivot's absolute value; moderate uses 1% and 10%. Other regular matches are weak. Hidden matches are always moderate. The ratio can be unstable near zero, and none of these thresholds is a measured probability.
Sources and next steps
Sources checked on October 16, 2026: TradingView's MACD and repainting documentation, and StockCharts' MACD-Histogram guide, linked above. Scanner-specific details come from this page's calculation and detection logic. For the arithmetic, use the MACD calculator. Browse the TradingView indicators guide for related chart concepts.
Educational information, not investment advice. Divergence does not guarantee a reversal or profit. Historical data can be delayed, missing or revised; verify a candidate on your chart before making a decision.