Technical analysis
RSI Explained: How the Relative Strength Index Is Calculated and Read
The relative strength index step by step: Wilder's formula, what 70 and 30 mean, why RSI stays overbought in a trend, and how divergence is read.
Updated · 4 min read
What RSI measures
The relative strength index compares the size of recent gains with the size of recent losses and puts the answer on a scale from 0 to 100. It was published by J. Welles Wilder in 1978 with a 14-period setting, and 14 is still the default on almost every chart.
The calculation runs in three steps. First, each bar's change is split into a gain (if the close rose) or a loss (if it fell), with the other side set to zero. Second, the gains and losses are averaged. The first average is a plain mean of the first 14 values; every one after that uses Wilder's smoothing, which is an exponential average with a long memory:
AvgGain(t) = (AvgGain(t − 1) × 13 + Gain(t)) / 14
The same line is run for losses. Third, the ratio of the two averages is squashed into the 0 to 100 range:
RS = AvgGain / AvgLoss and RSI = 100 − 100 / (1 + RS)
When gains and losses have been equal, RS is 1 and RSI is 50. When there have been no losses at all in the window, RSI is 100. Because the averages are smoothed rather than reset each bar, the reading on any bar depends on far more than the last 14 bars, which is why two charts with different amounts of history can show slightly different RSI values for the same date.
Overbought and oversold
The conventional lines are 70 and 30: above 70 the market is called overbought, below 30 oversold. What the numbers actually say is that recent gains have been more than about two and a third times recent losses (RS above 2.33), or the reverse. That is a statement about the recent past, not a forecast.
The most expensive mistake with RSI is reading overbought as a sell signal. In a strong uptrend RSI can stay above 70 for weeks, because the condition that puts it there, gains larger than losses, is the definition of the trend. Selling the first reading above 70 in a new bull market sells the best part of it.
| RSI reading | What it says | Common misreading |
|---|---|---|
| Above 70 | Gains have far outweighed losses recently | A top is in |
| 50 to 70 | Gains outweigh losses; typical of an uptrend | Nothing to see |
| 30 to 50 | Losses outweigh gains; typical of a downtrend | Nothing to see |
| Below 30 | Losses have far outweighed gains recently | A bottom is in |
A more useful frame treats the ranges as trend evidence. In an uptrend RSI tends to hold between about 40 and 80, finding support near 40 on pullbacks; in a downtrend it tends to hold between about 20 and 60, stalling near 60 on bounces. A reading that breaks out of its range, for instance RSI falling through 40 after months of holding it, says more about the trend than any single touch of 70 or 30.
Divergence
Divergence is the reading that earns RSI its place. When price makes a higher high but RSI makes a lower high, the second leg up was carried by smaller gains than the first: momentum has thinned even though price has not. That is bearish divergence. Bullish divergence is the mirror image: a lower low in price with a higher low in RSI.
Divergence is a warning, not a trigger. It can persist through several new highs before anything happens, and in a strong trend it often resolves by RSI catching back up rather than price turning. It becomes actionable when price confirms it, for example by closing below the swing low that sat between the two highs.
Wilder also described failure swings: RSI pushes above 70, pulls back, rises again but fails to exceed its previous peak, and then breaks below the pullback low. The pattern is read entirely on the indicator and does not require a divergence against price.
Settings and timeframes
Shorter settings such as RSI(7) or RSI(9) swing wider and reach the extremes more often; longer settings such as RSI(21) rarely do. Neither is more correct. A shorter RSI suits a chart used for timing entries within a trend; the standard 14 suits a chart used for judging the trend itself.
The timeframe matters more than the setting. RSI(14) on a daily chart summarises three weeks of sessions. On an hourly chart it summarises less than two sessions of a stock's trading, and readings above 70 and below 30 are routine. Reading a daily and an hourly RSI together, with the daily setting the direction and the hourly the timing, is the common way to use both.
On the desk
Every symbol page draws RSI(14) in its own pane under the candles, and the technical scoreboard folds RSI into one bounded score from −100 to +100 alongside trend and mean-reversion readings, so a stretched RSI is weighed against the trend it sits in rather than read alone.
Questions
- What RSI value is overbought?
- By convention a reading above 70 is called overbought and below 30 oversold. Above 70 means recent average gains have been more than about 2.3 times recent average losses. It describes the recent past and is not by itself a signal that price will turn.
- Can RSI stay above 70 for a long time?
- Yes. In a strong uptrend gains keep outweighing losses, which is exactly what keeps RSI above 70. It can hold there for weeks. In trends the ranges 40 to 80 (uptrend) and 20 to 60 (downtrend) are more informative than the 70 and 30 lines.
- What period should RSI be set to?
- Wilder's original and the standard everywhere is 14. Shorter settings reach the extremes more often and suit timing within a trend; longer settings suit judging the trend. The chart's timeframe changes the meaning of a reading more than the setting does.
- What is RSI divergence?
- Bearish divergence is price making a higher high while RSI makes a lower high: the second advance was carried by smaller gains. Bullish divergence is a lower low in price with a higher low in RSI. It warns that momentum has thinned and is acted on when price confirms it.
Related guides
Technical analysis
MACD explained
How MACD is built from two EMAs, what the signal line and histogram add, the three crossovers traders watch, and the cases where MACD misleads.
3 min read
Technical analysis
EMA 50 and EMA 200
How the 50 and 200 exponential moving averages are calculated, what a golden cross and a death cross mean, and how an EMA touch is read across timeframes.
5 min read
Technical analysis
Bollinger Bands
How Bollinger Bands are built from a 20-period average and two standard deviations, what %B and bandwidth measure, and how the squeeze and band walks are read.
3 min read
Macro and rates
The VIX explained
How the VIX is derived from S&P 500 option prices, the rule of 16 for a daily move, what its levels and term structure mean, and how it tracks stocks.
4 min read