RSI Formula

By: Lee Gettess

The following is an excerpt from Lee Gettess' Marksman: Trading the Turns Profitably

Relative Strength Index (RSI) was certainly popularized, if not developed by Welles Wilder.  It is discussed as a 5 period indicator for our purposes here.  But any length other than 5 can be used by substituting whatever value you choose for “5” in the formula.

This is a somewhat complicated formula, so we will break down the components.

AU = the total of up close days for the last 5 days
AD = the total of down close days for the last 5 days
RS = AU / AD

The final formula then is: RSI = 100 * (RS/(1 + RS))

The totals referred to by AU and AD are calculated by taking the actual close to close distance.  If a market closes 5 points higher than the previous close, then 5 is added to the AU.  On the other hand, if it closed down 5 points, that would add 5 to the AD.  It doesn’t matter where the market opened, or where the highs and lows were.  We are simply concerned with the close to close relationship.

A more in-depth explanation of RSI can be found in Welles Wilder’s book New Concepts In Technical Trading Systems.  He uses a pseudo-exponential moving average for AU and AD, which alters the actual reading slightly, but supposedly makes it easier to calculate each day once you have the indicator started.  That formula is:

AU = previous AU – (previous AU / 5) + today’s up close or zero
AD = previous AD – (previous AD / 5) + today’s down close or zero

This leaves you with a residual effect from previous calculations that will carry on through the indicator.

Examples follow:

Date

High

Low

Close

AU

AD

RSI

11/12

92800

90530

90830

 

 

 

11/13

92220

90300

91920

 

 

 

11/14

93500

91770

93260

 

 

 

11/17

95420

94190

94990

 

 

 

11/18

95190

94020

94260

 

 

 

11/19

95130

93770

94780

4680

730

86.5

11/20

96550

95200

96300

 

 

 

11/21

97100

95750

96960

 

 

 

To begin calculating a 5 RSI for 11/19, we see that we have 4 “up” closes in the last five days.  11/13 closes up by 1090.  11/14 closes up by 1340.  11/17 closes up by 1730.  11/19 closes up by 52.  In each case, we simply take the difference between the new higher close and the previous close.  Each of those is added together to become the AU.

AU = 1090 + 1340 + 1730 + 520 = 4680

The only down close was from 11/17 to 11/18, where we closed down 730.  If there were any other “down” closes in the last five days, they would have been added to the AD also.  As it is, our AD is just 730 all by itself.

Now, to calculate the RSI, remember the formula is 100 * (RS/(1 + RS), and RS = AU/AD.  So,

RS = 4680/730 = 6.41
RSI = 100 * (6.41/(1 + 6.41))
RSI = 100 * (6.41/7.41)
RSI = 100 * 865
RSI = 86.5

As you continue to maintain an RSI the readings will become less and less similar to how an RSI would be calculated in the very beginning.  There is a pseudo-exponential method used to maintain the indicator which leaves a residual effect from previous calculations.  I will show you how to do it, but I want you to understand that, mathematically speaking, once you have maintained the RSI calculations for some time, your results will become a fair amount different than if you just began to calculate it for any specific date.  Don’t be discouraged if you attempt to do this by hand and get drastically different results than your software does.  The difference is due to the number of bars the software has already included in its calculations.  Here is how it works.

Date

High

Low

Close

AU

AD

RSI

11/12

92800

90530

90830

 

 

 

11/13

92220

90300

91920

 

 

 

11/14

93500

91770

93260

 

 

 

11/17

95420

94190

94990

 

 

 

11/18

95190

94020

94260

 

 

 

11/19

95130

93770

94780

4680

730

86.5

11/20

96550

95200

96300

5264

584

90

11/21

97100

95750

96960

 

 

 

When we come to do the calculations for 11/20 we don’t go back and add up all of the up closes for the last five days to form the AU.  Instead, we take our previous AU reading of 4680 and subtract from it (4680/5), then add the new close of 1520.

AU = 4680 – (4680/5) + 1520
AU + 4680 – 936 + 1520 = 5264

AD = 730 – (730/5) + 0
AD = 730 – 146 + 0 = 584

RS = AU/AD = 5264/584 = 9.01

RSI = 100 * (9.01/10.01) = 90

Let’s continue on for an additional day:

Date

High

Low

Close

AU

AD

RSI

11/12

92800

90530

90830

 

 

 

11/13

92220

90300

91920

 

 

 

11/14

93500

91770

93260

 

 

 

11/17

95420

94190

94990

 

 

 

11/18

95190

94020

94260

 

 

 

11/19

95130

93770

94780

4680

730

86.5

11/20

96550

95200

96300

5264

584

90

11/21

97100

95750

96960

4871

467

91.2

The news calculations for 11/21 will again use the previous readings for AU and AD to generate the new ones.

AU = 5264 – (5264/5) + 660
AU += 5264 – 1053 + 660 = 4871

AD = 584 – (584/5) + 0
AD = 584 – 117 + 0 = 467

RS = AU/AD = 4871/467 = 10.43

RSI = 100 * (10.43/11.43) = 91.2

If you had just used the original formula of adding all the up and down closes for the last 5 days, you would have been left with an AU of 4430 and an AD of 730.  That would have brought the RSI calculation to 85.8.  As you can see, using this “pseudo-exponential” technique for the AU and AD does change things quite a bit over time.  It is the method that Welles Wilder laid out in his book, however.

Despite the apparent complexity of the indicator, it plots as just one simple little line on a graph scaled from 0 to 100.  If nothing else, it makes you appreciate how much easier computers make things for us.  Rather than go through these computations, you simply select RSI for a study and BAM!  It appears on the screen.  Virtually all commercially available graphics packages have RSI as one of their standard indicators.  Computers don’t really make you money, but they can certainly make your life easier.