GUIDE

RSI divergence explained: regular and hidden, bullish and bearish, and MACD divergence

Momentum · 6 min read

A divergence is price and an oscillator disagreeing: price makes a new low, RSI does not. It is one of the most drawn patterns in technical analysis and one of the easiest to draw wrongly, because a swing is only a swing once the bars after it have closed. This guide is how SixOne8 finds the swings, the four readings it offers, and why each is reported a few bars after the turn.

Price making a lower swing low while RSI makes a higher low on the same two bars, the two joined by lines, with the bar where the second low is confirmed highlighted
Illustrative candles. Price's second low is lower, RSI's reading on that bar is higher; the highlighted bar is where a bullish divergence is reported, five bars after the low itself.

What RSI divergence measures

Divergence compares two consecutive swings of price against the oscillator's value on the same two bars. There are four readings, two on each side:

  1. Bullish divergence. Price made a lower swing low; the oscillator made a higher low. The fall went further but with less behind it.
  2. Bearish divergence. Price made a higher swing high; the oscillator made a lower high.
  3. Hidden bullish divergence. Price made a higher swing low; the oscillator made a lower low. Often read as a pullback inside a rise.
  4. Hidden bearish divergence. Price made a lower swing high; the oscillator made a higher high.

The oscillator is RSI for RSI Divergence and MACD for MACD Divergence — the same lines those indicators draw on their own. Note that the swings are swings of price: the oscillator is read on the two bars where price turned, not at its own peaks and troughs, which can fall a bar or two either side. That is a deliberate choice, and it is why a divergence you sketch by eye from RSI's own troughs will occasionally not match the one the app reports.

How the swings are found, and why it is late

A swing low is a bar whose low is lower than the lows of the N bars before it and the N bars after it; a swing high is the same with highs. N is the swing strength, five by default. The catch is in "the bars after it": a low cannot be called a swing until those N later bars have closed without going lower. So every divergence is reported on the bar that confirms the second swing — with the default settings, five bars after the low or high itself.

That lag is the honest version of the pattern. A divergence drawn on the swing bar is one that can disappear when the next bar closes lower; the one SixOne8 reports has already survived those bars, and once reported it is never withdrawn. The price of that certainty is that by the time the condition is true, price has had five bars to move away from the turn. A larger swing strength finds fewer, more prominent swings and reports them later still.

RSI divergence settings

  1. RSI period. Fourteen by default — the RSI the divergence is read from.
  2. Swing strength (bars). How many bars on each side a high must stand above, or a low below, to count as a swing. Five by default, between two and twenty. Also the number of bars the report waits.
  3. Max swing gap (bars). The most bars allowed between the two swings. Sixty by default. Further apart than this, they are treated as separate moves and nothing is reported. Only consecutive swings are compared, so a rule cannot reach back three swings to find a disagreement somewhere.

MACD Divergence has the same two swing settings, MACD's own fast, slow and signal lengths (12, 26 and 9), and a choice of what price is compared against: the MACD line or the histogram.

How to use RSI divergence in a strategy

The comparisons are the four readings above, in the builder's own words: bullish divergence, bearish divergence, hidden bullish divergence and hidden bearish divergence. Each is true for one bar only, the bar the second swing is confirmed on.

RSI(14) on 4h  ·  bullish divergence  ·  5-bar swings

Read it as a sentence: on the 4-hour chart, price has made a lower swing low than the one before it, the fourteen-period RSI was higher on the second low than on the first, and the second low has just been confirmed by five closes that did not go below it. On the chart, the app draws the two lines a trader would: one joining the swings on price, one joining the same two bars in the RSI pane.

Because a divergence is one bar, it rarely lines up exactly with a second condition. The condition's Counts for setting lets it stay true for a few bars after it happens, so it can act as the context while something else — RSI crossing back above 30, or price closing above a recent high — is the trigger.

Does RSI divergence work on your market?

Run an entry check. It will tell you whether, on the market you care about, the moments this condition fired moved any differently from a random moment over the history tested — measured from the bar the divergence was reported, not from the turn, which is the only moment you could have acted on. Divergences are rarer than level crossings, so look at how many moments the check counted before reading much into the result. That result is a fact about the past on that market, and it is the only kind of fact a test here produces.

More momentum indicators

Next