# RSI Calculation

This page is a detailed guide how to calculate Relative Strength Index (RSI). You can see how the formulas work in Excel in the RSI Excel Calculator. The calculation is explained in detail in chapter 4 of the calculator’s guide.

## RSI Calculation Formula

• RSI = 100 – 100 / ( 1 + RS )
• RS = Relative Strength = AvgU / AvgD
• AvgU = average of all up moves in the last N price bars
• AvgD = average of all down moves in the last N price bars
• N = the period of RSI
• There are 3 different commonly used methods for the exact calculation of AvgU and AvgD (see details below)

## RSI Calculation Step by Step

1. Calculate up moves and down moves (get U and D)
2. Average the up moves and down moves (get AvgU and AvgD)
3. Calculate Relative Strength (get RS)
4. Calculate the Relative Strength Index (get RSI)

## Step 1: Calculating Up Moves and Down Moves

We’ll illustrate the calculation of RSI on the example of the most common period, 14. For RSI calculation you need closing prices of the last 15 days (for RSI with a period of 10, you need the last 11 closing prices etc.).

Let’s start with calculating the up moves and down moves in the last 14 days (or 14 price bars in general).

First, calculate the bar-to-bar changes for each bar: Chng = Closet – Closet-1

For each bar, up move (U) equals:

• Closet – Closet-1 if the price change is positive
• Zero if the price change is negative or zero

Down move (D) equals:

• The absolute value of Closet – Closet-1 if the price change is negative
• Zero if the price change is positive or zero

These up and down moves are calculated in columns C and D in the RSI Calculator.

Now you have the first important input for the RSI formula, the increases and declines in the last N days (with N being the RSI period). The next step is to average them.

## Step 2: Averaging the Advances and Declines

Three different approaches are commonly used. They differ in the way how average up and down moves are calculated:

• Simple Moving Average
• Exponential Moving Average
• Wilder’s Smoothing Method

### Simple Moving Average

Under this method, which is the most straightforward, AvgU and AvgD are calculated as simple moving averages:

AvgU = sum of all up moves (U) in the last N bars divided by N

AvgD = sum of all down moves (D) in the last N bars divided by N

N = RSI period

### Exponential Moving Average

Here AvgU and AvgD are calculated from up moves and down moves using an exponential moving average in the same way as you would calculate an EMA of price. The EMA period is the RSI period. The formula is:

AvgUt = α * Ut + ( 1 – α ) * AvgUt-1

AvgDt = α * Dt + ( 1 – α ) * AvgDt-1

α = 2 / ( N + 1 )

N = RSI period

### Wilder’s Smoothing Method

J. Welles Wilder, the inventor of RSI, calculated the indicator using a smoothing method with the same logic as an exponential moving average, only the smoothing factor is different:

α = 1 / N

and therefore 1 – α = ( N – 1 ) / N

N = RSI period

For example, for RSI 14 the formula for average up move is:

AvgUt = 1/14 * Ut + 13/14 * AvgUt-1

You will find the logic of these calculations is very similar to the calculation of Average True Range (ATR), another indicator invented by J. Welles Wilder.

## Step 3: Calculating Relative Strength

Now as you have the average up move (AvgU) and average down move (AvgD) in the last 14 price bars, the next step is to calculate Relative Strength, which is defined as the ratio of average up moves and average down moves.

RS = AvgU / AvgD

## Step 4: Calculating the Relative Strength Index (RSI)

Finally, we know the Relative Strength and we can apply the whole RSI formula:

RSI = 100 – 100 / ( 1 + RS)

## Lowest Possible RSI Value

What situation in the market would give us the lowest possible RSI value? A totally bearish market, of course. Imagine that every single day the market closed lower than the day before. There would be no up days (all the U’s in the last N bars would be zero). AvgU would be zero (for SMA method immediately after N bars, for EMA and Wilder’s methods it would gradually approach zero with each bar if there had been non-zero U’s before). The average decline (AvgD), on the other hand, would be some positive number (as you take absolute values when calculating the RSI). Relative Strength would be zero divided by something positive, which gives us zero. The RSI would be zero:

RSI = 100 – 100 / ( 1 + 0 ) = 100 – 100 = 0

## Highest Possible RSI Value

What situation in the market would give us the maximum possible RSI value? This would be a totally bullish market with no down days. AvgD would be zero, AvgU some positive number. Relative Strength would be something positive divided by zero. Mathematically, you can’t calculate this – in this case the RSI value is defined as 100. If the average decline would be some very low number, but not zero, Relative Strength would be close to infinite and the RSI would be close to 100:

RSI = 100 – 100 / ( 1 + a big number ) = 100 – 0 = 100

To conclude, RSI can reach values from 0 (bearish market) to 100 (bullish market).

## Comparing the Calculation Methods

The three calculation methods often give quite different results. While different traders have different preferences, most would agree that being consitent and sticking with one method (rather than jumping from one to another) is more important than which of the methods you choose (this also applies to RSI period length).

The RSI Calculator allows you to put up to 3 different RSI indicators on the chart at the same time, so you can compare how different settings looks in the same situation (for actual trading it is better to use just one, maybe two indicators simultaneously). Further explanation of RSI calculation methods and practical use is available in the calculator’s guide.

Have a question or feedback? It takes less than a minute.