RSI Indicator: Formula, Settings & Strategies

Every trader faces the same question many times a day: is this move running out of energy, or does it still have strength? Price alone doesn’t answer it. A stock can rise for ten days in a row, and you still can’t tell whether buyers are getting tired.

The RSI indicator (Relative Strength Index) turns that question into a single number between 0 and 100. It compares the size of recent gains with the size of recent losses, so you can see momentum at a glance.

In this guide you’ll learn exactly how RSI is calculated, with every step of the arithmetic shown, how to read it, how to adjust its settings for your trading style, three rule-based strategies, and the mistakes that cost RSI traders the most. One warning before we start: RSI isn’t a buy/sell button. It’s a measuring tool.

RSI quick facts

Full nameRelative Strength Index
CreatorJ. Welles Wilder Jr.
Year1978
TypeMomentum oscillator (moves between 0 and 100)
Default settings14 periods; levels 70 (overbought) and 30 (oversold)
Best marketsAny liquid market: stocks, indices, forex, crypto, commodities
Best timeframesWorks on all; most reliable on 15-minute charts and higher

Origin and history of the RSI

J. Welles Wilder Jr. introduced the Relative Strength Index in his 1978 book New Concepts in Technical Trading Systems. The same book also introduced several other tools traders still use every day, including the Average True Range (ATR), the Average Directional Index (ADX) and the Parabolic SAR. Wilder trained as a mechanical engineer and worked as a real estate developer before turning his engineering mindset to the markets.

Wilder wanted a momentum measure that solved two problems with simple “price change” calculations:

  1. No fixed scale. A $5 move means something very different in a $20 stock and a $2,000 stock. RSI always stays between 0 and 100, so you can compare readings across markets.
  2. Erratic jumps. Simple momentum lines can jump sharply when old data drops out of the calculation. Wilder’s smoothing method makes RSI move more steadily.

A common confusion: RSI is not the same as “relative strength” in the sense of comparing one stock against another (for example, a stock against the S&P 500). That’s a different concept that happens to share the name. RSI only looks at one market’s own price changes.

The RSI formula, step by step

RSI is calculated in six steps. We’ll use the default period of 14.

Step 1: Find the price change for each bar.
Change = Today’s close − Yesterday’s close

Step 2: Split each change into a gain or a loss.
– If the change is positive, Gain = change and Loss = 0
– If the change is negative, Gain = 0 and Loss = the size of the change (written as a positive number)

Step 3: Calculate the first averages (simple averages).
– First Average Gain = sum of gains over the last 14 bars ÷ 14
– First Average Loss = sum of losses over the last 14 bars ÷ 14

Step 4: Smooth every later average (Wilder’s smoothing).
– New Average Gain = (Previous Average Gain × 13 + Current Gain) ÷ 14
– New Average Loss = (Previous Average Loss × 13 + Current Loss) ÷ 14

Step 5: Calculate Relative Strength (RS).
RS = Average Gain ÷ Average Loss

Step 6: Convert RS to the 0–100 scale.
RSI = 100 − (100 ÷ (1 + RS))

Why Step 6 works: if gains and losses are equal, RS = 1 and RSI = 50. If there are no losses at all, RSI approaches 100. If there are no gains, RSI is 0.

Worked example (with every calculation shown)

Here are 15 sample closing prices, which give 14 price changes:

BarCloseChangeGainLoss
0100.00———
1101.20+1.201.200
2100.60−0.6000.60
3102.10+1.501.500
4103.00+0.900.900
5102.40−0.6000.60
6103.50+1.101.100
7104.20+0.700.700
8103.60−0.6000.60
9104.80+1.201.200
10105.50+0.700.700
11104.70−0.8000.80
12105.90+1.201.200
13106.40+0.500.500
14105.80−0.6000.60
Total9.003.20

First averages (Step 3)
– Average Gain = 9.00 ÷ 14 = 0.6429
– Average Loss = 3.20 ÷ 14 = 0.2286

RS and RSI (Steps 5–6)
– RS = 0.6429 ÷ 0.2286 = 2.8125
– RSI = 100 − (100 ÷ 3.8125) = 100 − 26.23 = 73.77

An RSI of 73.77 is above 70, so this market is “overbought” in RSI terms: recent gains have been much larger than recent losses.

Next bar (Step 4: Wilder’s smoothing)
Bar 15 closes at 104.90, a change of −0.90. So Gain = 0 and Loss = 0.90.
– New Average Gain = (0.6429 × 13 + 0) ÷ 14 = 8.3571 ÷ 14 = 0.5969
– New Average Loss = (0.2286 × 13 + 0.90) ÷ 14 = 3.8714 ÷ 14 = 0.2765
– RS = 0.5969 ÷ 0.2765 = 2.1587
– RSI = 100 − (100 ÷ 3.1587) = 100 − 31.66 = 68.34

One down bar pulled RSI from 73.77 to 68.34. Notice that the old averages still count for 13/14 of the new value. This “memory” is why RSI moves smoothly.

Why RSI values differ between platforms

You may see slightly different RSI values for the same chart on different platforms. There are two common reasons:

VersionHow the averages are calculatedEffect
Wilder’s RSI (the original)Wilder’s smoothing (also called RMA or SMMA)Smooth; the method used by TradingView’s built-in RSI
Cutler’s RSISimple moving average of gains and lossesReacts faster and can jump more; no long “memory”
EMA-based RSIExponential moving averageSlightly faster than Wilder’s version

History matters too. Because Wilder’s smoothing remembers old data, the very first RSI values on a chart depend on how much price history the platform has loaded. After about 100 or more bars, the differences become very small.

How to read the RSI indicator

1. Overbought (above 70) and oversold (below 30)
These words are often misunderstood. Above 70 means recent gains have been much stronger than recent losses. It doesn’t mean “price must fall now”. In a strong uptrend, RSI can stay above 70 for a long time.

2. The 50 centreline
RSI above 50 means average gains are bigger than average losses, a bullish momentum bias. Below 50 is a bearish bias. Many traders use 50 as a simple momentum filter.

3. RSI ranges change with the trend
As a general guideline (not a strict rule), RSI often moves within different ranges depending on the trend:
– Uptrend: RSI tends to stay roughly between 40 and 80, and pullbacks often stop near 40–50.
– Downtrend: RSI tends to stay roughly between 20 and 60, and rallies often stop near 50–60.

If RSI keeps finding support near 40 during pullbacks, buyers are still in control.

4. Divergence
Divergence happens when price and RSI disagree. For example, price makes a lower low but RSI makes a higher low. This can be an early warning that momentum is changing, but it’s not a signal on its own. Always wait for price to confirm it. We cover all four types, with chart examples, in our guide to RSI divergence.

5. Failure swings (Wilder’s own signal)
– Bearish failure swing: RSI rises above 70, pulls back, rises again but fails to make a new high, then falls below its previous pullback low.
– Bullish failure swing: the mirror image below 30.

Wilder considered these signals stronger than simple 70/30 touches because they show momentum actually weakening.

RSI settings: a deep dive

What each setting controls

SettingDefaultIf you lower itIf you raise it
Length (period)14Faster, more signals, more noise; reaches 70/30 more oftenSmoother, fewer signals; rarely reaches 70/30
Upper / lower levels70 / 30Narrowing to 60/40 gives more signals, of lower qualityWidening to 80/20 gives fewer but more extreme signals
SourceClose—Using HL2 or HLC3 (averages of high, low and close) gives a slightly smoother line

Rule of thumb: when you shorten the length, widen the levels. A 7-period RSI hits 70/30 so often that 80/20 usually works better.

Starting settings by trading style

These are starting points to test, not “best” settings. The right choice depends on your market and how volatile it is.

StyleTypical chartRSI lengthLevelsNotes
Scalping1–5 min5–780 / 20Very noisy; only trade in the direction of the higher-timeframe trend
Intraday5–15 min9–1470 / 30Avoid the first few minutes after the open, when moves are erratic
Swing1 hour – daily1470 / 30Use the trend ranges (40–80 / 20–60) for pullbacks
PositionalDaily – weekly14–2170 / 30Slower signals, better for spotting stretched markets

Very short RSI: some traders use extremely short settings, such as a 2-period RSI, for short-term pullback trading. This approach was developed by trader and author Larry Connors. It behaves very differently from the standard 14-period version, and we’ll cover it separately.

For side-by-side chart comparisons of different lengths, see our guide to the best RSI settings.

3 rule-based RSI strategies

These strategies are educational examples, not recommendations. Test any strategy on historical charts and in a demo account before using real money, and always decide your risk per trade in advance.

Strategy 1: Range mean-reversion

Idea: in a sideways market, price tends to swing back from extremes.

  • Market condition: ADX(14) below 20 (a weak trend), with price moving between clear support and resistance.
  • Entry (long): RSI falls below 30, then closes back above 30. Enter on the next bar, ideally near support.
  • Stop-loss: just below the most recent swing low.
  • Exit: when RSI reaches 50–60, or price reaches the middle or top of the range.
  • Short version: the mirror image: RSI rises above 70, then closes back below 70 near resistance.
  • Avoid when: ADX rises above 25 (a trend is starting), or ahead of major news.

Strategy 2: Trend pullback

Idea: in an uptrend, buy when momentum dips briefly but buyers stay in control.

  • Market condition: price is above a rising 200-period EMA (Exponential Moving Average), and RSI has recently been above 60.
  • Entry (long): RSI pulls back into the 40–50 zone, then turns up, and price closes above the previous bar’s high.
  • Stop-loss: below the low of the pullback.
  • Exit: take part of the profit at your first target (for example, twice the amount you risked). Exit the rest if RSI closes below 40, which suggests the trend’s momentum has faded.
  • Short version: in a downtrend (price below a falling 200 EMA), sell when RSI rallies into 50–60 and turns down.
  • Avoid when: the 200 EMA is flat, which means there’s no clear trend.

Strategy 3: Divergence with confirmation

Idea: divergence warns that momentum is weakening, but wait for price to confirm it.

  • Market condition: after an extended move down. Price makes a lower low, while RSI makes a higher low, ideally with the first RSI low below 30. This is called bullish divergence.
  • Entry (long): only when price closes above the most recent swing high (a “break of structure”). Never enter on divergence alone.
  • Stop-loss: below the divergence low.
  • Exit: at the next major resistance, or when RSI reaches 70.
  • Short version: price makes a higher high while RSI makes a lower high, and you enter after price breaks the most recent swing low.
  • Avoid when: the trend is very strong. Divergence can appear several times before a real reversal, or never lead to one.

RSI confluence: what to pair it with

Confluence means using tools that measure different things, so that each one adds new information.

Pair RSI withWhat it addsHow to use it
200 EMATrend directionOnly take long RSI signals above it, short signals below it
ADXTrend strengthADX < 20: use RSI at 70/30 for reversals. ADX > 25: use RSI for pullbacks only
Bollinger BandsVolatility extremesAn RSI extreme plus price outside the bands marks a more stretched market
Volume or VWAPParticipationSignals backed by rising volume, or happening near VWAP, are more meaningful

Redundant pairings to avoid: RSI + Stochastic + Williams %R + CCI. All four are momentum oscillators calculated from the same price data, so they usually agree with each other. Four indicators saying the same thing isn’t four confirmations; it’s one signal repeated. Pick one oscillator and pair it with a trend, volatility or volume tool instead.

Limitations and common mistakes

  1. Selling just because RSI is above 70. In strong trends, RSI can stay overbought for weeks while price keeps rising. Overbought describes strength, not a top.
  2. Ignoring the bigger trend. A 30 reading on a 5-minute chart means little if the daily chart is in a steep downtrend.
  3. Expecting RSI to predict. RSI is calculated from past prices, so it always lags somewhat. It describes momentum; it doesn’t forecast.
  4. Over-optimising the settings. Changing the length until past signals look perfect usually fails on new data. Keep settings simple and test them across different markets.
  5. Trading divergence too early. Without a price confirmation, divergence trades often get stopped out repeatedly.
  6. Misunderstanding repainting. Standard RSI doesn’t change past values once a bar has closed, but the current bar’s RSI moves until the bar closes. A signal you see mid-bar can disappear. Some multi-timeframe RSI scripts can also repaint history if they’re coded to look ahead. Always judge signals on closed bars.

RSI indicator FAQ

What is the best RSI setting for day trading?
There’s no single best setting. The default 14 is a solid start on 5- to 15-minute charts. Many day traders test 9 for faster signals, usually with wider levels such as 80/20. Test any setting on your own market before using it live.

What does RSI above 70 mean?
It means average gains have been much larger than average losses over the last 14 bars, a sign of strong upward momentum. It doesn’t automatically mean the price will fall.

Is RSI a leading or lagging indicator?
Technically it’s lagging, because it’s calculated from past closing prices. It’s sometimes called “leading” because divergence can warn of a momentum change before price turns.

Does RSI work for crypto and forex?
Yes. The formula works on any price series. Crypto is often more volatile, so readings above 70 or below 30 happen more often, and some traders use 80/20 levels instead.

How is RSI calculated in TradingView?
TradingView’s built-in RSI uses Wilder’s smoothing (RMA) of gains and losses, with a default length of 14 calculated on closing prices. Its settings also include an optional “Smoothing” section, which adds a moving average of the RSI line.

RSI vs MACD: which is better?
Neither is better; they measure momentum differently. RSI is fixed between 0 and 100, which makes “stretched” readings easy to see. MACD is based on moving averages and has no fixed range, which makes it better for following trend momentum. Many traders use one momentum tool and pair it with a trend filter rather than using both. See our full comparison: MACD vs RSI.

Keep learning

Ready to fine-tune RSI for your own trading? Our next guide compares RSI lengths side by side on real charts: Best RSI Settings for Scalping, Day & Swing Trading. Wondering whether to use RSI or the Stochastic? Read our RSI vs Stochastic comparison. Compare RSI with MACD and Stochastic in our Momentum Indicators guide.


How we checked this guide

  • Method: Formula and worked example verified in code
  • Chart: Real TradingView data, Bitcoin (BTC/USD) 4-hour, at least 30 days old
  • Repainting: Does not repaint on closed bars

See how we test indicators →

Risk disclaimer: This article is for educational purposes only and isn’t investment advice or a recommendation to buy or sell any security, currency or cryptocurrency. Trading involves a significant risk of loss, and past performance doesn’t guarantee future results. The strategies shown are examples for learning; test any approach yourself and consider speaking with a qualified financial professional before trading.