Metric · Price and risk

RSI (Relative Strength Index) Calculated Step by Step

RSI compresses recent up moves and down moves into a single reading between 0 and 100. Working it once by hand shows exactly what it responds to, and what it ignores.

AI-assisted, reviewed by John James → 4 min read Published

Formula

100 − 100 ÷ (1 + RS), where RS is the average gain ÷ the average loss over N periods, usually 14

RSI (14): A momentum oscillator from 0 to 100 that compares the size of recent up closes with recent down closes, so a high reading means gains have outweighed losses lately.

Also shown as Relative strength index, RSI, Wilder's RSI.

RSI 78. Plenty of charting panels will color that line red and tag it overbought. Before deciding whether that means anything, it helps to know what went into it, because the number is built from nothing but the size of recent up days against the size of recent down days, and once you have worked it by hand the labels stop sounding like forecasts.

The standard setting is 14 periods. The example below uses 5, purely so the arithmetic fits on a screen. The steps are identical.

Step 1: price changes

Take six closing prices. Five changes come out of them. Split each change into a gain column and a loss column, and record losses as positive numbers.

Step 2: averages, RS and RSI

An RS of 3 says the average up day was three times the size of the average down day. The formula squeezes that ratio onto a 0 to 100 scale. Equal gains and losses give RS of 1 and an RSI of exactly 50. No losses at all push RSI to 100.

Step 3: Wilder’s smoothing

Most tools do not recompute a plain average each day. After the first value, the method Welles Wilder published with the indicator carries the old averages forward and blends in each new bar with a weight of one part in N.

A one-dollar gain moved RSI from 75 to about 78. Smoothing means every old bar keeps some influence, fading over time. Because of it, RSI on the same stock can differ slightly between two tools that started their calculation from different dates, and a few platforms use a simple or exponential average in place of Wilder’s, which shifts the readings a little more.

One quirk follows from the math. RSI weighs the size of moves, so a stock with a few very large up days and many tiny down days can post a high reading even though most of its days were down. Count the bars as well as reading the line.

What 70 and 30 are

They are conventions. Wilder suggested them, and they stuck. Above 70 gets called overbought and below 30 oversold, but nothing in the math makes those levels thresholds where price has to turn. In a strong uptrend RSI can sit above 70 for weeks while the stock keeps climbing, because most days are up days and the average gain stays large. Selling every time the line crosses 70 in that kind of market means selling a trend repeatedly on its way up, and in a steady downtrend the same trap waits below 30 for anyone who buys each oversold reading.

Some traders shift the bands to fit the regime, treating 40 as support for RSI in an uptrend or 60 as resistance in a downtrend. Others use 80 and 20 on volatile stocks. None of these numbers is special. They are rules of thumb.

Divergence

A divergence is a mismatch between price and RSI. Price makes a new high. RSI makes a lower high than it did at the previous peak. The reading suggests the latest push up came on smaller gains than the one before it, and some traders take that as a sign momentum is fading. The mirror image, a lower low in price with a higher low in RSI, gets read as selling pressure easing. Divergences can persist through several more highs before anything turns, so they work better as a prompt to look closer than as a trigger.

Where it shows up and how to use it

RSI is an indicator you add in a charting panel, usually with 14 as the default period, and some screeners let you filter on the 14-day reading. It measures momentum over a short window. That makes it a reasonable companion to slower trend tools like the 50-day and 200-day moving averages: a trader might only act on low RSI readings while price holds above the 200-day, using RSI to time an entry inside a trend that the moving average has already defined. Indicators built on averages lag by construction, a point argued in crossovers are late by design, and RSI shares a milder form of that lag. Timeframe changes what the number covers. Fourteen hourly bars span about two trading days, while fourteen weekly bars span more than three months, so the two readings can point in opposite directions on the same stock at the same moment. Shorter periods make it twitchy. A 5-period RSI touches the extremes constantly, and anyone using one needs wider bands before a reading means much.

Pair it with average true range if you also need to size the position. On its own, RSI tells you how lopsided the recent moves have been, and nothing about where price goes next.