Advertisement
Advertisement
INVESTING

RSI Calculator — Wilder's relative strength index

Compute the relative strength index over any period from a series of closing prices, using Wilder's original smoothing rather than a simple average, and see the average gain, average loss and relative strength behind the number.

Separate with commas, spaces or new lines. You need at least one more observation than the period length, because the first RSI value consumes n price changes.
Wilder used 14. Shorter periods produce a more volatile index, longer periods a smoother one.
Wilder's method is the definition. The simple average is offered only so you can see how far it drifts.
Conventionally 70. A descriptive label only.
Conventionally 30. A descriptive label only.
Relative strength index, latest observation
 
0
Average gain
0
Average loss
0
Relative strength (RS)
0
RSI values produced
RSI 0–100
Gain share
Loss share
Tip: the RSI bar and the gain-share bar are the same number. RSI is simply the proportion of recent average movement that happened on up days, scaled to 0–100. Seeing that once makes the index much harder to over-interpret.
Advertisement

An RSI calculator computes the relative strength index, a bounded oscillator introduced by J. Welles Wilder Jr. in New Concepts in Technical Trading Systems (1978). It compares the average size of recent up moves with the average size of recent down moves and expresses the result on a 0–100 scale. It describes past prices. Past behaviour does not predict future prices, and nothing this page produces is a signal, an entry, or a recommendation to trade.

Arb Digital publishes this next to the moving average calculator for smoothing and the pivot point calculator for the classic level conventions. Where a moving average smooths the price level itself, RSI ignores the level entirely and looks only at the sizes of the changes — which is why two instruments trading at very different prices can produce identical RSI values.

What This RSI Calculator Does

It implements Wilder's definition exactly, which matters because a great many implementations do not.

The index is built from the average gain and average loss over n periods. Wilder's smoothing is a specific recursive scheme, sometimes called a modified or running moving average: after the initial seed, each new average is the previous average multiplied by (n − 1), plus the current period's gain or loss, all divided by n. That is equivalent to an exponential average with a smoothing constant of 1 ÷ n, not 2 ÷ (n + 1).

Using a plain rolling arithmetic mean of the last n gains instead produces a different, more jagged series. It is a legitimate statistic; it is not RSI. This page offers it under a clearly labelled comparison option so you can see the size of the divergence, but the default and the definition are Wilder's.

Alongside the index the calculator exposes the components — average gain, average loss and the relative strength ratio between them — because the components are more interpretable than the scaled output, and a surprising number of RSI misreadings dissolve once you can see them.

How to Use It

  1. Enter closing prices oldest first. RSI is computed from period-to-period changes, so a reversed series produces a plausible-looking number describing nothing.
  2. Supply more observations than the period. Fourteen periods of change require fifteen prices. Supplying exactly n gives you n − 1 changes and no valid index.
  3. Give it more history than the minimum. Wilder's smoothing carries the seed value forward with decaying weight. An RSI computed from exactly n + 1 prices is dominated by the seed; one computed from several times n has largely forgotten it. This is why charting platforms disagree slightly at the left edge of a chart.
  4. Keep the period fixed when comparing. A 7-period and a 21-period RSI on the same series are different statistics, and neither is a smoothed version of the other.
  5. Treat the convention levels as labels. The 70 and 30 fields change wording only. They are conventions from Wilder's book, not thresholds this page endorses or tests.

The Formula / How It's Calculated

Split each period's price change into a gain and a loss, where a gain is the change when positive and zero otherwise, and a loss is the absolute change when negative and zero otherwise. Both are non-negative by construction.

Seed the two averages with a simple mean over the first n changes:

AvgGainn = (sum of the first n gains) ÷ n and AvgLossn = (sum of the first n losses) ÷ n

Then apply Wilder's smoothing for every subsequent period:

AvgGaint = [AvgGaint−1 × (n − 1) + Gaint] ÷ n

AvgLosst = [AvgLosst−1 × (n − 1) + Losst] ÷ n

Relative strength is the ratio of the two, and the index rescales it into a bounded range:

RS = AvgGain ÷ AvgLoss, then RSI = 100 − 100 ÷ (1 + RS)

When average loss is zero the ratio is undefined and RSI is defined as 100. When average gain is zero, RSI is 0.

Worked example, matching the values the page loads with. Twenty closes are supplied and the period is 14. Over the first fourteen changes the gains sum to 3.34 and the losses to 1.40, so the seed averages are 3.34 ÷ 14 = 0.238571 and 1.40 ÷ 14 = 0.100000. Relative strength is 2.385714 and the first index value is 100 − 100 ÷ 3.385714 = 70.4641.

Smoothing forward through the remaining five closes gives 66.2496, 66.4809, 69.3469, 66.2947 and finally 57.9150. At that last point the average gain is 0.189820, the average loss is 0.137936 and relative strength is 1.376145. The index has fallen without the price series collapsing, because the final change of −0.58 is large relative to the recent average move.

Advertisement

Why Wilder's Smoothing Is Not Optional

This is the correctness point, and it is worth being precise about.

Wilder's recursion is an exponentially weighted average with α = 1 ÷ n. A conventional EMA of period n uses α = 2 ÷ (n + 1). At n = 14 those are 0.0714 and 0.1333 — the standard EMA reacts roughly twice as fast. A simple rolling mean of the last n gains behaves differently again, because it drops observations abruptly out of the back of the window.

The practical size of the difference is not small. On the same series, a 14-period RSI computed with a rolling simple mean can sit several points away from the Wilder version, and the gap widens exactly when a single large move enters or leaves the window. Anyone comparing an RSI reading against a published one, or reproducing a documented figure, will fail to match unless the smoothing matches.

There is a second, subtler consequence. Because Wilder's average never fully forgets, RSI is path-dependent over the whole history supplied, not just the last n periods. Two people with the same last fifty prices but different start dates will get slightly different values. That is a property of the definition, not an error in either calculation.

What the 70 and 30 Levels Actually Are

They are conventions from Wilder's 1978 book, and they are descriptive labels, nothing more.

RSI above 70 is conventionally described as overbought and below 30 as oversold. Those words describe where the index sits relative to a customary boundary. They are not instructions, and the statement "RSI above 70 means sell" is advice rather than description — and it is not supported by the arithmetic, which contains no information about what happens next.

A well-documented property makes the point concretely: in a strongly trending series, RSI can remain above 70 for a long stretch, because a persistent run of up moves keeps average gain far above average loss. The index is doing exactly what it is defined to do. Reading it as a countdown to reversal misunderstands what is being measured.

Wilder himself used different boundaries in different contexts, and later practitioners routinely shift them by instrument and period. That flexibility is a clue: if a threshold has to be re-tuned per instrument to remain sensible, it is a description of that instrument's typical behaviour, not a general rule. The NBER working paper Foundations of Technical Analysis sets out what a rigorous test of any such pattern actually requires.

Period Length, Bounds and the Shape of the Index

RSI is bounded between 0 and 100 by construction, because RS is a ratio of two non-negative numbers and the transformation maps [0, ∞) onto [0, 100). That bound has consequences people often read as meaning.

First, the index compresses at the extremes. Moving from RS = 9 to RS = 19 takes RSI from 90 to 95 — a doubling of relative strength produces five points. Near 50 the same proportional change moves the index far more. Equal-sized moves in the index therefore do not represent equal-sized changes in the underlying ratio.

Second, period length changes the achievable range in practice. A 2-period RSI spends much of its life pinned near 0 or 100, because a single change dominates the averages. A 50-period RSI rarely leaves the middle band. Comparing a short-period reading with a long-period convention level is a category error, and it is common.

Third, RSI says nothing about magnitude of price movement in currency terms. A 1% move and a 10% move that arrive in the same pattern of ups and downs can produce the same index. For the size of what actually happened, the stock return calculator and the max drawdown calculator measure outcomes rather than shape, and the standard deviation calculator measures dispersion. FINRA's overview of investment risk covers the categories no single indicator captures.

Tracking momentum in your own traffic and rankings?

Arb Digital measures marketing series with the same discipline — the method named, the window fixed, and no conclusion drawn from a number that only describes last month.

See SEO Services Talk to Arb Digital

Common Mistakes to Avoid

  • Using a simple rolling mean instead of Wilder's smoothing — the result is a different statistic that will not reconcile with any published RSI figure.
  • Comparing RSI values computed over different periods — a 7-period and a 21-period index have different typical ranges, so the same reading means different things.
  • Feeding it too little history — with only n + 1 prices the seed dominates, and the value will drift as more data is added.
  • Reading a level as an instruction — 70 and 30 are conventions describing where the index sits, and a bounded oscillator carries no information about future prices.
  • Expecting divergence to be a defined quantity — divergence between price and RSI is a visual impression, not part of the formula, and different observers identify different instances on the same chart.

Related Free Tools From Arb Digital

Run the same price column through the moving average calculator for simple, weighted and exponential smoothing, or the pivot point calculator for classic, Fibonacci, Camarilla and Woodie levels. For outcome measures rather than shape, use the max drawdown calculator, the annualized return calculator and the Sharpe ratio calculator. The standard deviation calculator handles dispersion on the same data. Everything else is in the free online tools hub.

Frequently Asked Questions

Who created the relative strength index?

J. Welles Wilder Jr. published it in New Concepts in Technical Trading Systems in 1978, along with the smoothing method the index depends on. The original definition uses a 14-period lookback and the recursive average described in that book, which is what this calculator implements by default.

Why does Wilder's smoothing matter?

Because it defines the statistic. Wilder's average is exponential with a smoothing constant of 1 divided by n, not the 2 divided by n plus 1 used by a conventional EMA, and not a plain rolling mean. Substituting either alternative produces a different series that will not match any published RSI figure.

Does RSI above 70 mean I should sell?

No. Above 70 is conventionally described as overbought, which is a statement about where the index sits relative to a customary boundary. It is not an instruction and carries no information about future prices. In a strongly trending series the index can stay above 70 for long stretches, because that is what the formula does when up moves persist.

How many prices do I need?

At least one more than the period, because the index is built from period-to-period changes. In practice supply several times the period. Wilder's smoothing carries the seed value forward with decaying weight, so a short history leaves a visible residue that a longer history has largely forgotten.

What does relative strength mean here?

It is the ratio of the average gain to the average loss over the smoothing window. A ratio of 1 means up and down moves have averaged the same size, which maps to an index of 50. The index is simply that ratio rescaled onto a bounded 0 to 100 range.

Why does my platform show a different RSI?

Usually the smoothing method, the period, the price field or the amount of history loaded. Some platforms seed differently or use a simple average. Because Wilder's average never fully forgets earlier data, two calculations over the same recent window but different start dates will differ slightly by design.

Can RSI reach exactly 0 or 100?

Yes, at the boundaries. If every change in the smoothing window is an increase, average loss is zero, the ratio is undefined and the index is defined as 100. If every change is a decrease, average gain is zero and the index is 0. Both are edge cases the formula handles explicitly.

Is a shorter period better?

Neither is better; they are different. A short period reacts to individual changes and spends more time near the extremes, while a long period is smoother and rarely leaves the middle band. What matters is stating which period produced a figure, because the same reading means different things at different lengths.

This tool performs an arithmetic calculation on data you supply. It is not investment advice, not a recommendation to buy, sell or hold any security, and its output is not a trading signal. Technical indicators describe past prices only. Decisions about your money should involve a licensed financial adviser regulated in your jurisdiction.

Advertisement
Advertisement

Take it further