Learn › Technical analysis

RSI Explained: Wilder's Formula, 70/30, and Why Overbought Can Keep Rising

RSI from Wilder's formula with a worked 14-period example, how to read 70, 30 and 50, the range shift in trends, failure swings and RSI as a trend filter.

Beginner 9 min read 16 October 2026

What you will learn
  • RSI compares the average up move with the average down move over 14 bars, giving a 0 to 100 reading of past momentum. It doesn't predict the future
  • Above 70 doesn't mean price has to fall. In uptrends RSI tends to swing around 40–80, in downtrends around 20–60
  • Fading 70/30 works better in ranges. In trending markets, using RSI with the momentum fits better
  • RSI doesn't tell you where to put your Stop loss. Place it from price structure and size the trade yourself

RSI (Relative Strength Index) measures whether price has recently been rising harder than it falls, or falling harder than it rises, shown as a single line from 0 to 100. J. Welles Wilder Jr. published it in a 1978 book, and today almost every platform has it built in. Most people only know “above 70 is overbought, below 30 is oversold”. Once you understand the formula, you can see why that rule works in some markets and loses money in others.

How RSI is calculated

It uses closing prices. For each bar, look at how far it closed above or below the previous close.

  1. If the bar closed higher, the distance is a gain. If it closed lower, the distance is a loss (written as a positive number)
  2. Find the average gain and average loss over 14 bars. The first time, it is the sum divided by 14
  3. RS = average gain ÷ average loss
  4. RSI = 100 − 100 ÷ (1 + RS)

Rearranged, RSI is simply average gain ÷ (average gain + average loss) × 100, the share of all movement that went up. RSI 50 means up and down moves were equal. RSI 80 means 80% of the movement was up. If none of the 14 bars closed lower, RSI is 100.

From the 15th bar on, Wilder doesn’t re-average the last 14 bars. He uses Wilder smoothing:

New average = (previous average × 13 + latest bar’s value) ÷ 14

The latest bar gets a weight of 1/14, the same as a 27-period EMA, so the line is smoother and slower than a plain average. It is the SMMA type described in Moving averages. MT5 and TradingView both use this formula, with a default of 14 periods on the close.

Worked example: RSI 14 step by step

Fifteen sample closes starting at 100.00 give 14 changes.

BarCloseChangeGainLoss
1101.20+1.201.20
2100.80−0.400.40
3102.00+1.201.20
4102.50+0.500.50
5101.90−0.600.60
6103.10+1.201.20
7103.80+0.700.70
8103.20−0.600.60
9104.50+1.301.30
10104.10−0.400.40
11105.00+0.900.90
12104.60−0.400.40
13105.80+1.201.20
14106.30+0.500.50
Total8.702.40
  1. Average gain = 8.70 ÷ 14 = 0.6214
  2. Average loss = 2.40 ÷ 14 = 0.1714
  3. RS = 0.6214 ÷ 0.1714 = 3.625
  4. RSI = 100 − 100 ÷ (1 + 3.625) = 100 − 21.62 = 78.38

Check with the share formula: 8.70 ÷ (8.70 + 2.40) × 100 = 78.38. It matches.

Bar 15 closes at 105.40, down 0.90. Now apply Wilder smoothing:

  1. New average gain = (0.6214 × 13 + 0) ÷ 14 = 8.0786 ÷ 14 = 0.5770
  2. New average loss = (0.1714 × 13 + 0.90) ÷ 14 = 3.1286 ÷ 14 = 0.2235
  3. RS = 0.5770 ÷ 0.2235 = 2.582
  4. RSI = 100 − 100 ÷ 3.582 = 72.08

The biggest down bar in the set only takes RSI from 78.38 to 72.08, still above 70. This is the habit to understand: RSI remembers recent momentum, and one bar is not enough to flip the picture.

Reading 70, 30 and the 50 line

  • Above 70 (overbought): up moves made up more than 70% of recent movement. Price has risen fast
  • Below 30 (oversold): down moves made up more than 70%. Price has fallen fast
  • The 50 line: up and down moves are equal. RSI staying above 50 means buyers are in control, below 50 means sellers are

“Overbought” sounds like “too expensive, must fall”, but all it really means is “has risen hard”. Price that has risen hard can keep rising hard.

Why overbought can keep rising: the range shift

In a ranging market, price swings inside a box and RSI uses its full range, reaching around 70 when price hits the top of the box and around 30 at the bottom. That is where the 70/30 rule fits.

In a trend, the whole RSI range shifts. The idea, popularised by Andrew Cardwell and Constance Brown, is:

  • Uptrend: RSI tends to swing around 40–80. On pullbacks it only drops to 40–50 before turning up, and rarely reaches 30
  • Downtrend: RSI tends to swing around 20–60. On bounces it only reaches 50–60, and rarely gets to 70

These are rules of thumb, not fixed lines, but they help a lot. If RSI keeps failing to reach 40 on pullbacks and keeps pushing above 70, you are looking at an uptrend, and selling every time it goes above 70 means fighting the trend.

RangeUptrendDowntrend Touches 70 and 30RSI swings ~40–80RSI swings ~20–60 705030 RSI 14
An illustrative 160-bar price series built for this article, not real market data. RSI 14 is calculated with Wilder's formula from the same prices. In the range, RSI reaches 72.5 as price hits the top of the box, and price does fall. In the uptrend, RSI first crosses 70 at a price of 103.7, but price keeps rising to 108.5 and RSI never dips below 44.9. Once the downtrend is under way, RSI's highest bounce is 45.7.

Failure swings: the signal Wilder favoured

Wilder didn’t rely on touching 70/30 alone. He gave weight to a pattern called the failure swing, which only looks at the RSI line, not at price.

Bearish failure swing (at a top)

  1. RSI rises above 70
  2. RSI pulls back. The low of this pullback is the reference level
  3. RSI bounces again but stays below 70 (the new push is weaker than the last one)
  4. RSI breaks below the reference level from step 2. That is the signal that upward momentum has run out

Bullish failure swing (at a bottom) is the mirror image: RSI drops below 30, bounces, drops again but stays above 30, then breaks above the high of the first bounce.

① Above 70 ② Pullback sets the level ③ Bounce stays below 70 ④ Breaks level ② = signal 7050 Diagram, not real data
A diagram of a bearish failure swing, drawn to explain the pattern, not taken from real data. The signal comes at point ④, when RSI breaks the level of point ②, not when RSI drops back below 70.

The strength of a failure swing is that it waits for momentum to actually fade instead of fading the move the moment RSI touches 70. In a strong trend it can still mislead: RSI may break the reference level because price is just moving sideways, and then the trend continues.

Divergence in brief

Divergence is when price and RSI go different ways, for example price makes a new high but RSI makes a lower high. It says the latest push had less momentum than the one before. It doesn’t say when price will turn. In a long trend, divergence can appear several times before price really reverses. For regular versus hidden divergence, and how to draw it without fooling yourself, read Regular and hidden divergence.

Using RSI as a trend filter

Another way to use RSI is to go with its nature: let it tell you which side is in control, and only trade that side.

  • The 50 filter: only look for buys when RSI is above 50 and only sells when it is below 50. Some traders read it on a higher timeframe than the chart they enter on
  • Wait for the pullback in an uptrend: in an uptrend, wait for RSI to pull back to the 40–50 zone and start turning up, instead of chasing above 70
  • Overbought as momentum: some breakout systems only enter when RSI is very high, because they want price to have the push to keep going. The opposite of the textbook

In our backtest, a short-box breakout system on gold (XAUUSD) M1, from 2022 to mid-2026 at 0.01 lot per trade, used RSI 14 from the M15 chart as a momentum filter: buy only when RSI was 75 or higher, and sell only when it was 35 or lower.

  • The number of trades fell from 20,634 to 5,787 (28% remained)
  • No losing year (5 positive years out of 5), while the unfiltered version had one losing year
  • But the filtered version’s total profit over the whole period was 824 dollars lower than without the filter. It helped in two years (mostly in 2026), but also cut good trades in the others

The 2022–2025 data is simulated ticks built from price data, not real ticks, which can make results look better than reality. Read it as a picture of the trade-off, not the size of the profit. Backtest results do not predict future results. A filter doesn’t create extra profit. It trades the number of trades for steadiness. If you want to measure trend strength directly, see ADX and trend strength.

Which period to use

The standard is 14, the value Wilder used. A shorter period makes RSI faster and jumpier, a longer one makes it smoother. Here it is on the same price series as the first chart, counted from bar 25 to bar 160:

PeriodCrosses above 70Crosses below 30Lowest–highest
RSI 79 times4 times6.5–90.5
RSI 145 times3 times21.0–78.9
RSI 213 times1 time26.7–73.0
1007050300 RSI 7: fast, crosses often RSI 21: smooth, rarely reaches
RSI 7 and RSI 21 calculated with Wilder's formula from the same illustrative price series as the first chart (not real market data). Same prices, only the number of bars changes. RSI 7 crosses 70 or 30 a total of 13 times, RSI 21 only 4 times.

With a short period, move the lines out too, for example to 80/20, or the signals become so frequent they mean nothing. A well-known example is Larry Connors’ RSI 2, which uses 10 and 90. With a long period, move the lines in, for example to 60/40, because it rarely reaches 70/30.

Pick a setting and stick with it. Don’t change it to match the chart you just looked at. The setting that looks best on past data is often just the one that happened to fit that stretch. More in Overfitting.

RSI and risk management

RSI tells you about momentum, not how much you lose if you’re wrong. Every time RSI is your reason to enter, answer two more questions:

  1. Where is the Stop loss? Place it from price structure, such as beyond the latest swing low, or use volatility to set the distance. See ATR and Stop loss placement. Not “exit when RSI comes back to 50”, because price can travel any distance before that happens
  2. How big is the trade? Work it out from the Stop loss distance and the amount you’re willing to lose per trade, as in Position size from your Stop loss

RSI helps you read momentum. It doesn’t tell you where price will go. Sizing your trades is what keeps you alive when your RSI read is wrong.

If you pair RSI with Stochastic or MACD, keep in mind that they are all momentum indicators calculated from the same closing prices. They tend to signal together, so it looks like three confirmations, but it’s really one set of data. More in Combining indicators without redundancy.

Common mistakes

  • Selling every time RSI goes above 70. In an uptrend RSI can stay above 70 for a long time. Check whether the market is trending or ranging first
  • Assuming RSI at 30 means a bounce is due. In a strong downtrend RSI can stay below 30, and price can keep falling a long way
  • Entering the moment RSI touches a line. Wait for price or RSI to confirm, such as a failure swing or price breaking a swing low
  • Tuning the period and lines to fit past charts and expecting the same results in the future
  • Using several momentum indicators to confirm each other. RSI, Stochastic and MACD mostly say the same thing
  • No Stop loss because “RSI already said so”. RSI is calculated from prices that have already happened. It knows nothing about the news or orders still to come
Try it with your own numbers

Frequently asked questions

What is the best RSI setting?

The standard is 14 periods with lines at 70 and 30, which is what Wilder used and what most traders watch. Shorter settings like 7 swing harder and signal more often. Longer ones like 21 are smoother and rarely reach the lines. No setting is best for every market, and tuning it to fit past charts rarely carries into the future.

Should I sell as soon as RSI goes above 70?

Not as your only reason. In a strong uptrend RSI can stay above 70 for a long time while price keeps rising. Check first whether the market is trending or ranging, and wait for price to confirm, for example by breaking the latest swing low.

Does RSI on MT5 match TradingView?

Both use Wilder's formula on closing prices by default, so the values should be very close. They can differ slightly if the broker's prices differ or if a different amount of history is loaded, because Wilder's average still carries some effect from older bars.

This is general education, not investment advice. Trading is risky and you may lose all of your capital.

Tools Chat on LINE