Relative Strength Index (RSI) Calculation Explained
- Average gain
- 5
- You entered
- Average loss
- 3
- You entered
The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and magnitude of recent price changes. It is calculated using a formula that compares average gains to average losses over a specified period, typically 14 days, and outputs a value between 0 and 100. Enter your price data or gains/losses into the calculator below to get the RSI instantly.
Formula
The standard RSI formula, as developed by J. Welles Wilder Jr., is:
RSI = 100 – (100 / (1 + RS))
Where RS (Relative Strength) = Average Gain ÷ Average Loss.
- Average Gain – the average of all upward price changes over the lookback period (e.g., 14 periods). If there are no gains, average gain = 0.
- Average Loss – the average of all downward price changes (as positive numbers) over the same period. If there are no losses, average loss = 0.
In the calculator above, you enter the average gain and average loss directly. The formula then computes the RSI. Note that if average loss is 0, the RSI is defined as 100 (since RS is infinite).
Worked Example
Using the default values from the calculator: average gain = 5, average loss = 3.
- Compute RS = 5 / 3 = 1.6667
- Compute RSI = 100 – (100 / (1 + 1.6667)) = 100 – (100 / 2.6667) = 100 – 37.5 = 62.5
The calculator rounds to two decimals, giving an RSI of 62.50. This value indicates that gains are stronger than losses over the period, but not yet in overbought territory (typically above 70).
How to Calculate Average Gain and Loss
To compute the average gain and loss manually, follow these steps for a 14-period RSI (the most common setting):
- List the closing prices for the last 15 periods (14 changes).
- For each period, subtract the previous close from the current close. If the difference is positive, it is a gain; if negative, it is a loss (use the absolute value).
- Sum all gains and divide by 14 to get the initial average gain. Do the same for losses.
For subsequent periods, Wilder’s smoothing method is used:
- Average Gain = [(Previous Average Gain × 13) + Current Gain] / 14
- Average Loss = [(Previous Average Loss × 13) + Current Loss] / 14
This smoothing gives more weight to recent price action, which is why the RSI reacts quickly to new moves.
How to Read the RSI
The RSI ranges from 0 to 100. Traditional interpretations:
- Above 70 – overbought, meaning the asset may be due for a pullback or price correction.
- Below 30 – oversold, suggesting a potential bounce or rally.
- Around 50 – neutral, indicating balanced momentum.
However, these thresholds are not absolute. In strong uptrends, the RSI can stay above 70 for extended periods; in strong downtrends, it can stay below 30. Many traders use the RSI to confirm trends rather than as a standalone signal.
Common Mistakes and Misconceptions
One common mistake is using simple moving averages instead of Wilder’s smoothing. Wilder’s method is exponential-like and is the standard. Another error is forgetting that average loss is always a positive number in the formula. If you accidentally use a negative loss, the RSI will be wrong.
Also, the RSI does not predict the future; it only reflects past price changes. A high RSI does not guarantee a price drop, and a low RSI does not guarantee a rise. It is a momentum indicator, not a reversal signal.
Another misconception is that the RSI is only for daily charts. It can be used on any timeframe – hourly, weekly, or even minute-by-minute – as long as you recalculate the averages for that period.
Choosing the RSI Period
The default period is 14, but you can adjust it based on your trading style:
- Shorter periods (e.g., 7 or 9) – more sensitive, producing more signals, but also more false signals.
- Longer periods (e.g., 20 or 25) – smoother, with fewer signals but higher reliability.
There is no “best� period; it depends on the asset’s volatility and your strategy. Experiment with different settings to see what works for your timeframe.
Limitations of the RSI
The RSI is a lagging indicator – it is based on historical data, so it reacts after the price has already moved. It also does not account for volume, which some traders find useful. In choppy or sideways markets, the RSI can give many conflicting signals.
Additionally, the RSI can remain in overbought or oversold territory for a long time during strong trends, which can lead to premature entries if you rely solely on it. Always consider using the RSI alongside other indicators or price analysis.
Frequently Asked Questions
What does an RSI of 50 mean?
An RSI of 50 indicates that average gains equal average losses over the period. This suggests balanced momentum, with no clear bullish or bearish edge. It is often seen as a neutral level.
Can RSI go above 100 or below 0?
No. The formula mathematically confines the RSI to a range of 0 to 100. When average loss is 0, RSI equals 100; when average gain is 0, RSI equals 0.
Why is the RSI sometimes called a momentum oscillator?
Because it oscillates between fixed boundaries (0 and 100) and measures the momentum of price changes. It is a bounded oscillator, unlike unbounded indicators like MACD.
How is RSI different from Stochastic Oscillator?
RSI measures the speed of price changes based on closing prices, while the Stochastic Oscillator compares the closing price to the price range over a period. They are both momentum indicators but use different calculations and produce different signals.
What is Wilder’s smoothing and why does it matter?
Wilder’s smoothing is a method of averaging that gives more weight to recent data points. It is used in the RSI calculation to make the indicator more responsive to recent price action, which is why the RSI reacts quickly to new trends.
Related
Formula used
in g | Average gain | - | 5 | 0 in l | Average loss | - | 3 | 0 out rsi | RSI | - | 100 - (100 / (1 + (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.