The Relative Strength Index (RSI) is a momentum oscillator introduced by J. Welles Wilder Jr. in his 1978 book New Concepts in Technical Trading Systems. It compares the size of recent up moves with the size of recent down moves and squeezes the result into a scale from 0 to 100. A reading near 100 means almost every recent change was a gain; a reading near 0 means almost every change was a loss; 50 means gains and losses balanced out.
This RSI calculator takes a column of closing prices — daily, weekly or any bar size — and applies Wilder’s original method: a simple average of the first n gains and losses, then his smoothing rule for every later bar. You get the latest RSI, the average gain and loss behind it, the relative strength ratio, the very first RSI value and a full table with the RSI on each row, plus a chart with the overbought and oversold lines.
It is useful for checking a number shown by a charting platform, for back-testing a rule in a spreadsheet, or simply for understanding what the indicator really measures. RSI describes past price behaviour; it does not predict prices, and nothing on this page is investment advice.
How to use this calculator
- Paste the closing prices, oldest first. You need at least period + 1 prices; 100 or more give a value that matches charting software closely.
- Keep the period at 14 (Wilder’s choice) or change it — 9 for a faster line, 21 or 25 for a smoother one.
- Adjust the overbought and oversold levels if you use a different convention, such as 80/20.
- Read the latest RSI and its zone, then scroll the table to see how the value developed bar by bar.
The formula
For each bar, the change is ; a gain is and a loss is .
The first averages are simple means of the first changes:
Every later average uses Wilder’s smoothing:
Then
If the average loss is zero, RSI is 100. Wilder’s smoothing is an exponential average with weight , slower than the usual EMA weight .
Worked example
Take the 20 default closes (100.00 up to 106.60) and a 14-period RSI.
- The first 14 changes contain gains that average 0.6929 and losses that average 0.2071 per bar.
- RS = 0.6929 ÷ 0.2071 = 3.3448, so the first RSI is 100 − 100 ÷ (1 + 3.3448) = 76.98 — well into overbought territory after a steady climb.
- The next five closes include three declines. After smoothing, the average gain falls to 0.6041 and the average loss rises to 0.2795, giving a latest RSI of 68.37: still positive momentum, but no longer extreme.
Overbought, oversold and other ways to read RSI
Wilder suggested 70 and 30 as the levels where a move may be stretched. They are conventions, not rules:
| RSI | Common reading |
|---|---|
| Above 70 | Overbought: strong gains, watch for a pause |
| 50 to 70 | Bullish momentum |
| 30 to 50 | Bearish momentum |
| Below 30 | Oversold: heavy losses, watch for a rebound |
In a powerful trend RSI can sit above 70 (or below 30) for a long time, so many analysts also look at divergences — price makes a new high while RSI does not — and at failure swings around the 50 line. Combine the reading with levels from the pivot point calculator or with position sizing, never in isolation.
Why my RSI differs from my charting platform
Three things explain most gaps. History length: Wilder’s smoothing never forgets, so the value depends slightly on where the series starts; with 250 bars of history the effect is negligible. Method: some platforms use a simple moving average (Cutler’s RSI) or a standard EMA instead of Wilder’s rule. Data: adjusted versus unadjusted closes after dividends or splits change every change.
Frequently asked questions
Why 14 periods?
Wilder chose 14 because it is half of a 28-day cycle he observed in markets. Nothing magic happens at 14: shorter periods react faster and touch 70/30 more often; longer periods are smoother and rarely reach the extremes.
Can RSI reach exactly 0 or 100?
Only if every change in the smoothing window was a loss, or every change was a gain. Because Wilder’s average decays slowly, a single opposite move keeps RSI away from the limits for a long time.
Does RSI work on weekly or intraday data?
Yes. RSI only needs a sequence of closes, so it works on any bar size. Keep in mind that 14 weekly bars cover about three months of trading.
Is RSI the same as relative strength versus an index?
No. The RSI compares a security with its own past gains and losses. “Relative strength” in the comparative sense divides one asset’s price by a benchmark’s price — a different tool despite the similar name.
Should I buy when RSI is below 30?
Not on that basis alone. An oversold reading only says the recent declines were large; prices can keep falling. Treat RSI as one input among others, and consider the risk of a position with the value at risk calculator. This page is not investment advice.
Sources
- Wilder, J. W. (1978). New Concepts in Technical Trading Systems. Trend Research
- StockCharts ChartSchool — Relative Strength Index (RSI), calculation and worked spreadsheet
Last updated: