Relative Strength Index Calculator: Formula & How to Use
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This relative strength index (RSI) calculator works out the RSI value for a series of price data you enter, using the standard Wilder smoothing method, and returns a number between 0 and 100 that indicates whether an asset is overbought or oversold. You enter a list of closing prices (or any numeric series) and the period length (commonly 14), and the calculator applies the RSI formula to produce the current RSI reading. The result helps traders and analysts gauge momentum, but it is not a buy or sell signal on its own.
Formula
The RSI is calculated from the average gains and average losses over a chosen period. The standard formula, using Wilder’s smoothing, is:
RSI = 100 – (100 / (1 + RS))
where RS = Average Gain / Average Loss.
For the initial calculation (the first RSI value), the average gain is the sum of all gains over the past n periods divided by n, and the average loss is the sum of all losses over the past n periods divided by n. For subsequent periods, Wilder’s smoothing is applied:
- Average Gain = [(Previous Average Gain × (n – 1)) + Current Gain] / n
- Average Loss = [(Previous Average Loss × (n – 1)) + Current Loss] / n
All variables are unitless (they are price changes). The period n is typically 14, but can be adjusted. If average loss is zero, RSI is defined as 100.
Worked Example
Using the default price series: 44.34, 44.09, 44.15, 43.61, 44.33, 44.83, 45.10, 45.42, 45.84, 46.08, 45.89, 46.03, 45.61, 46.28, 46.28, with n = 14.
First, compute the price changes from one close to the next:
- 44.09 – 44.34 = -0.25 (loss)
- 44.15 – 44.09 = +0.06 (gain)
- 43.61 – 44.15 = -0.54 (loss)
- 44.33 – 43.61 = +0.72 (gain)
- 44.83 – 44.33 = +0.50 (gain)
- 45.10 – 44.83 = +0.27 (gain)
- 45.42 – 45.10 = +0.32 (gain)
- 45.84 – 45.42 = +0.42 (gain)
- 46.08 – 45.84 = +0.24 (gain)
- 45.89 – 46.08 = -0.19 (loss)
- 46.03 – 45.89 = +0.14 (gain)
- 45.61 – 46.03 = -0.42 (loss)
- 46.28 – 45.61 = +0.67 (gain)
- 46.28 – 46.28 = 0.00 (neither gain nor loss)
Sum of gains: 0.06 + 0.72 + 0.50 + 0.27 + 0.32 + 0.42 + 0.24 + 0.14 + 0.67 = 3.34
Sum of losses: 0.25 + 0.54 + 0.19 + 0.42 = 1.40
Average gain = 3.34 / 14 = 0.2386
Average loss = 1.40 / 14 = 0.1000
RS = 0.2386 / 0.1000 = 2.386
RSI = 100 – (100 / (1 + 2.386)) = 100 – (100 / 3.386) = 100 – 29.53 = 70.47
So the RSI for this series is approximately 70.47, which is near the overbought threshold of 70.
What the RSI Tells You
The RSI is a momentum oscillator that measures the speed and magnitude of recent price changes. Values above 70 are often considered overbought, suggesting the price may be due for a pullback or consolidation. Values below 30 are considered oversold, suggesting a possible bounce. However, these thresholds are not absolute; in strong uptrends, RSI can stay above 70 for extended periods, and in strong downtrends, it can stay below 30.
RSI is used in several ways:
- Identifying overbought/oversold conditions
- Spotting divergences: if price makes a new high but RSI does not, it may signal weakening momentum
- Confirming trend strength: RSI above 50 often aligns with an uptrend, below 50 with a downtrend
- Using centerline crossovers (50) as a trend filter
How to Choose the Period and Thresholds
The default period of 14 is the most common, but shorter periods (e.g., 9) make the RSI more sensitive, producing more frequent signals. Longer periods (e.g., 25) smooth the indicator, reducing noise but lagging more. The 70/30 thresholds are traditional, but some traders adjust them based on the asset’s volatility. For highly volatile assets, thresholds like 80/20 may be more appropriate; for low-volatility assets, 60/40 might be used.
When using the calculator, you can enter any period you like. For daily charts, 14 is standard; for intraday, some use 7 or 9. The key is consistency: use the same period and thresholds across different assets for comparison.
Common Mistakes and Misconceptions
A frequent mistake is using simple averages instead of Wilder’s smoothing. The first RSI value uses a simple average, but subsequent values must use the smoothed formula; otherwise, the indicator will differ from standard charting software. Another error is mixing up gains and losses: a zero change counts as neither a gain nor a loss, so it is simply ignored.
A common misconception is that RSI above 70 means the price will definitely fall. That is not true; it only indicates that gains have been large relative to losses over the period. In a strong uptrend, RSI can stay above 70 for a long time. Similarly, a low RSI does not guarantee a bounce. RSI is a probability tool, not a certainty.
Also, be careful with data frequency: RSI calculated on daily closes will differ from one based on hourly closes. Always use the same timeframe for the signals you are comparing.
Limitations of the RSI Formula
The RSI is a lagging indicator because it is based on past prices. It can give false signals in choppy, sideways markets. It also does not account for volume, volatility, or fundamental factors. The formula assumes that gains and losses are equally weighted, which may not suit all assets. Additionally, the RSI is not normalized across different assets; a value of 60 for one stock may be more extreme than for another.
In the calculator, the RSI is computed only for the final value in the series; it does not plot a line over time. For a full RSI chart, you would need to apply the formula to a rolling window, which this calculator does not do. However, you can use it to check a specific point or to verify your own calculations.
How to Read the Result
The output is a number between 0 and 100. A value of 50 means average gains equal average losses, indicating balanced momentum. Values above 50 suggest more or larger gains than losses over the period; values below 50 suggest the opposite. The calculator also shows the average gain and average loss, which are useful for understanding the components. For example, an RSI of 70 can result from a high average gain and low average loss, or from a moderate gain and very low loss.
If the average loss is zero, the RSI is set to 100, which is correct: if there have been no losses over the period, the asset is at maximum upward momentum. Similarly, if the average gain is zero, the RSI is 0.
Frequently Asked Questions
What is a good RSI value? There is no universally good value; it depends on the context. Traditionally, above 70 is overbought and below 30 is oversold, but in strong trends, these levels can be exceeded. Some traders use 80/20 for stronger signals.
Can I use RSI for any asset? Yes, RSI works on any price series, including stocks, forex, commodities, and cryptocurrencies. It is a mathematical formula applied to price changes, so it does not depend on the asset type.
Why is my RSI different from my trading platform? The most likely reason is the smoothing method. Many platforms use Wilder’s smoothing for the entire series, while some use a simple moving average. Also, check the period and whether the platform uses exponential or simple averaging. This calculator uses Wilder’s smoothing, which is the standard.
Does RSI work better on higher timeframes? RSI can be used on any timeframe, but signals are generally more reliable on higher timeframes (daily, weekly) because there is less noise. On intraday charts, RSI may produce many false signals.
What is RSI divergence? Divergence occurs when price makes a higher high but RSI makes a lower high (bearish divergence), or price makes a lower low but RSI makes a higher low (bullish divergence). It suggests that momentum is not confirming the price move, which can precede a reversal.
Can I use RSI alone for trading? It is not recommended. RSI is best used with other indicators, such as moving averages or trendlines, and with proper risk management. No single indicator is foolproof.
Related
Formula used
in list | Price series | 44.34, 44.09, 44.15, 43.61, 44.33, 44.83, 45.10, 45.42, 45.84, 46.08, 45.89, 46.03, 45.61, 46.28, 46.28 | 0 in n | Period | 14 | 1 out rsi | RSI | - | 100 - (100 / (1 + rs)) | 2 out avg_gain | Average gain | - | avg_gain | 4 out avg_loss | Average loss | - | avg_loss | 4
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.