Relative Strength Index Calculation Explained
- RS (avg gain / avg loss)
- Result
- Period
- 14 periods
- You entered
- Average gain
- 2.5 points
- You entered
The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements, calculated on a scale from 0 to 100. To compute it, you average the gains and losses over a chosen period (typically 14), then apply the formula RSI = 100 – [100 / (1 + RS)], where RS is the average gain divided by the average loss. This article explains the exact step-by-step calculation, how to interpret the result, and common pitfalls to avoid.
Formula
The RSI formula is:
RSI = 100 – [100 / (1 + RS)]
Where:
- RS = Average Gain ÷ Average Loss over the lookback period
- Average Gain = sum of all upward price changes over the period, divided by the period length
- Average Loss = sum of all downward price changes (as positive numbers) over the period, divided by the period length
The result is always between 0 and 100. If average loss is zero, RSI is set to 100 by convention (because RS would be infinite).
Worked Example
Using the default values from the calculator: period = 14, average gain = 2.5 points, average loss = 1.2 points.
- Compute RS: 2.5 ÷ 1.2 = 2.0833
- Add 1: 2.0833 + 1 = 3.0833
- Divide 100 by that: 100 ÷ 3.0833 = 32.4324
- Subtract from 100: 100 – 32.4324 = 67.57
The calculator gives RSI = 67.57, matching the manual computation.
How the RSI Is Actually Calculated in Practice
Most charting platforms use Wilder’s smoothing method, not a simple average. For the first RSI value, you take the simple average of gains and losses over the initial 14 periods. For each subsequent period, you update the averages using:
- Average Gain = [(Previous Average Gain × 13) + Current Gain] ÷ 14
- Average Loss = [(Previous Average Loss × 13) + Current Loss] ÷ 14
This gives more weight to recent price action and is the standard used in most software. The simple average version (as in the calculator above) is a close approximation and useful for understanding the concept.
Choosing the Period Length
The default period is 14, introduced by J. Welles Wilder in 1978. Shorter periods (e.g., 7 or 9) make the RSI more sensitive, generating more signals but also more false ones. Longer periods (e.g., 20 or 25) smooth the indicator, reducing noise but lagging price moves. Traders often adjust the period to match their trading style: day traders might use 7, swing traders 14, and long-term investors 20 or more.
Interpreting the RSI Value
The RSI is primarily used to identify overbought and oversold conditions:
- Above 70 – considered overbought, possibly due for a pullback
- Below 30 – considered oversold, possibly due for a bounce
- 50 level – acts as a midline; values above indicate bullish momentum, below bearish
However, in strong trends, the RSI can stay in overbought or oversold territory for extended periods. Many traders also watch for divergence: if price makes a new high but RSI makes a lower high, it may signal weakening momentum and a potential reversal.
Common Mistakes and Misconceptions
One frequent error is using the simple average instead of Wilder’s smoothing, which can produce slightly different values. Another is forgetting to treat losses as positive numbers – a loss of 2 points should be recorded as 2, not –2. Also, the RSI is not a standalone signal; it should be used with other indicators like moving averages or support/resistance levels. Overbought does not mean “sell immediately” – it only indicates that the recent move has been unusually large.
Limitations of the RSI
The RSI is a lagging indicator – it uses past data and may give late signals in fast markets. It also performs poorly in choppy, sideways markets where it whipsaws between overbought and oversold. The formula assumes a constant period and does not account for volatility changes. Some variations, like the Stochastic RSI, apply the RSI formula to the RSI itself to reduce noise.
Frequently Asked Questions
What does an RSI of 70 mean?
An RSI of 70 or above is traditionally considered overbought, suggesting the asset may be overvalued and due for a price correction. However, in a strong uptrend, the RSI can remain above 70 for a long time, so it is not a guaranteed sell signal.
What is the best RSI period?
The 14-period RSI is the most common and works well for most markets. Shorter periods like 7 or 9 react faster but generate more false signals; longer periods like 20 or 25 are smoother but lag more. The best period depends on your trading timeframe and style.
How do I calculate RSI in Excel?
In Excel, you can calculate RSI using the formula: =100-(100/(1+(average_gain/average_loss))). You need to compute the average gain and average loss over the period, using Wilder’s smoothing if you want to match charting platforms. Many spreadsheets use the simple average, which is fine for a rough estimate.
Can RSI be above 100 or below 0?
No, the RSI is mathematically bounded between 0 and 100. If average loss is zero, the RSI is set to 100. If average gain is zero, the RSI is 0. Values outside this range indicate a calculation error.
Is RSI a leading or lagging indicator?
RSI is a lagging indicator because it is based on past price data. It can help identify potential reversals, but it does not predict future prices with certainty. It is best used in combination with other analysis tools.
What is the difference between RSI and Stochastic Oscillator?
Both are momentum oscillators, but RSI measures the magnitude of recent gains versus losses, while the Stochastic Oscillator compares the closing price to the price range over a period. RSI is smoother and less sensitive to short-term volatility, while Stochastic reacts faster and can generate more signals.
Related
Formula used
in n | Period | periods | 14 | 1 in g | Average gain | points | 2.5 | 0 in l | Average loss | points | 1.2 | 0 out rsi | RSI | - | 100 - (100 / (1 + (g / l))) | 2 out rs | RS (avg gain / avg loss) | - | g / l | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.