[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

excel code - RSI



PureBytes Links

Trading Reference Links

Columns

a=date
b=open
c=high
d=low
e=close
f=vol
g=up momentum
h=down momentum
i=up average
j=down average
k=RSI

.Stocks & Commodities V. 11:7 (292-297): SIDEBAR: CALCULATING THE RSI

CALCULATING THE RSI

The RSI classic

The first step in calculating a 14-period relative strength index (RSI) in a
Microsoft Excel spreadsheet is
determining the up momentum and the down momentum. This is performed in
columns G and H in
sidebar Figure 1. The formula for up momentum beginning with cell G3 is:
=IF (E3>E2, E3-E2, 0)
The formula for down momentum beginning with cell H3 is:
=IF(E3<E2, ABS (E3-E2), 0)
Next, the average up momentum is calculated in column I. Only the first
day's calculation uses a simple
moving average. The formula for cell I16 is:
=AVERAGE(G3:G16)
The first day's average down momentum in column J uses a simple moving
average. The formula for cell
J16 is:
=AVERAGE(H3:H16)
>From this point on, the original RSI formula uses a different smoothing
method for calculating the
average up and down momentum. The formula uses yesterday's average up
momentum multiplied by 13
plus today's up momentum and then divides by 14. This formula is used for
the remainder of column I.
The formula beginning with cell I17 is:
=(I16*13+G17)/14
The same formula is used for calculating the average down momentum in column
J. The formula
beginning with cell J17 is:
= (J16*13+H17)/14
The RSI is calculated in column K. The formula beginning with cell K16 is:
=100-(100/(1+(I16/J16)))
RSI modifications
The first RSI modification uses a simple moving average for smoothing all
the up and down momentum.
Instead of entering the smoothing formulas in cells I17 and J17 (as
discussed above), simply use the same
formulas in I16 and J16 for all of columns I and J, respectively.
Another smoothing method is to use an exponential moving average for
smoothing the up and down
momentum. Use the simple moving average formula for cells I16 and J16 to
start and then substitute the
following formula in column I, beginning with cell I17:
=(0.133*G16+(1-0.133)*I16)
The new formula for column J beginning with cell J17 is:
=(0.133*H16+(1-0.133)*J16)
RSI plus volume

Article Text 1 Copyright (c) Technical Analysis Inc.


Thanks Chuck for the help

Best regards

Walter