Indicators

What RSI, the Relative Strength Index, Is and How to Calculate It

The RSI, or relative strength index, is one of the most used momentum indicators in technical analysis. It compares the strength of an asset's recent gains with the strength of its recent losses, generating a number between 0 and 100 that helps identify when a move may be overly stretched.

The RSI formula

The calculation starts with the average gain and the average loss over a defined number of periods, usually 14. From these averages, the relative strength is calculated, called RS:

RS = average gain / average loss

Then, RS is converted to the 0-to-100 scale using the formula:

RSI = 100 − [100 / (1 + RS)]

An example worked by hand

To simplify the math, here's an example with just 5 price changes, instead of the usual 14, purely to illustrate the calculation. Suppose the following daily closes for a stock: R$ 10.00; R$ 10.20; R$ 10.15; R$ 10.40; R$ 10.30; R$ 10.50.

The changes from one close to the next were:

  • Day 2: +R$ 0.20 (gain)
  • Day 3: −R$ 0.05 (loss)
  • Day 4: +R$ 0.25 (gain)
  • Day 5: −R$ 0.10 (loss)
  • Day 6: +R$ 0.20 (gain)

The average gain, adding the three gains and dividing by the 5 changes, comes to (0.20 + 0.25 + 0.20) / 5 = 0.13. The average loss, adding the two losses and dividing by the 5 changes, comes to (0.05 + 0.10) / 5 = 0.03. The relative strength comes to RS = 0.13 / 0.03 = 4.33. Applying the final formula: RSI = 100 − [100 / (1 + 4.33)] = 100 − 18.76 = 81.24.

An RSI near 81 indicates recent gains clearly dominated over losses in this simplified period, placing the indicator in an overbought reading.

How to interpret overbought and oversold levels

The traditional reading considers values above 70 as overbought, suggesting the rally may be stretched, and values below 30 as oversold, suggesting the same for a decline. These numbers aren't an automatic buy or sell signal. In a strong uptrend, the RSI can stay above 70 for quite a while, and selling every time it crosses that level can mean exiting a trend that still had plenty of room to continue.

Divergence: when price and RSI disagree

A divergence happens when the price makes a new high, but the RSI makes a lower high than the previous one, suggesting the upward move is losing strength under the surface, even while the price is still rising. The same applies in reverse, with the price making a lower low while the RSI makes a higher low. Divergence is a warning of possible weakening momentum, not a guarantee of an immediate reversal.

Common mistakes when using the RSI

  • Treating every crossing of 70 or 30 as an automatic entry signal, ignoring the bigger trend's context.
  • Using the RSI in isolation, without checking support, resistance, or the chart's overall structure.
  • Comparing the RSI of different assets as if the same number meant the same thing in any volatility context.
  • Ignoring the timeframe: an RSI calculated on a 5-minute chart measures something quite different from the same indicator on a daily chart.

RSI across different timeframes

The same asset can show quite different RSI readings depending on the chart used. An RSI calculated on 5-minute candles reacts to very short-term swings and can alternate between overbought and oversold several times within a single day. An RSI calculated on daily or weekly candles, on the other hand, tends to move more slowly and usually reflects longer-term moves. Before comparing the RSI reading against a fixed rule, it's worth confirming the chosen timeframe makes sense for the type of trade planned, whether a quick day trade or a multi-day position.

How to use the RSI more responsibly

The RSI works best as one piece within a broader analysis, not as an isolated entry trigger. Combining the RSI reading with the bigger timeframe's trend, with support and resistance levels, and with the price's reaction near those levels usually generates more reliable readings than simply using a fixed number's crossover. Like any technical indicator, the RSI describes the price's past behavior and doesn't guarantee what will happen next.

Practice before you risk. Open your Astron account and test your ideas on the demo account with R$ 10,000 in virtual funds.

Create free account