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

RE: Relative Strength Index



PureBytes Links

Trading Reference Links

Wilder uses his own form of "exponential" smoothing in his RSI.  That is
why the function "Wilders Smoothing" was added to version 6.5 of
MetaStock for Windows 95 & NT.  Basically, on day 15 and all subsequent
days, Wilder takes the previous average up close and multiplies it by
13, add today's up close (if any) and divides that value by 14.  He does
the same with the average Down close.  You then divide the ups by the
downs, add 1.00 to it and divide that into 100 and then subtract that
result from 100.  You have the RSI.  Note how he uses a value multiplied
by 13 and divides by 14 for a 14 time period RSI.

To match this in a custom formula, you must use the "Wilders Smoothing"
function.

Here is a custom formula to use other than the close in the calculation.
It is posted on our web page.

Custom Relative Strength Index formula (for MetaStock 6.5 only)

This formula will request the price data array to use when plotting.  If
you plan to use this in an exploration or system test, be
certain you change the default time periods and price data array
selection to the inputs you wish as the exploration or system
test will not prompt for the input, it will use the default values.  For
more information, please review the sections in the
MetaStock 6.5 manual on inputs and variables.

 

Q:=Input("Time Periods",1,1000,14);

B:=Input("Field: 1=Close, 2=Open, 3=High, 4=Low, 5=Volume",1,5,1);

Z:=If(B=1,Wilders(If(ROC(C,1,$)>0,ROC(C,1,$),0),LastValue(Q)),

If(B=2,Wilders(If(ROC(O,1,$)>0,ROC(O,1,$),0),LastValue(Q)),

If(B=3,Wilders(If(ROC(H,1,$)>0,ROC(H,1,$),0),LastValue(Q)),

If(B=4,Wilders(If(ROC(L,1,$)>0,ROC(L,1,$),0),LastValue(Q)),Wilders(If(RO
C(V,1,$)>0,ROC(V,1,$),0),LastValue(Q))))));

Y:=If(B=1,Wilders(If(ROC(C,1,$)<0,Abs(ROC(C,1,$)),0),LastValue(Q)),

If(B=2,Wilders(If(ROC(O,1,$)<0,Abs(ROC(O,1,$)),0),LastValue(Q)),

If(B=3,Wilders(If(ROC(H,1,$)<0,Abs(ROC(H,1,$)),0),LastValue(Q)),

If(B=4,Wilders(If(ROC(L,1,$)<0,Abs(ROC(L,1,$)),0),LastValue(Q)),Wilders(
If(ROC(V,1,$)<0,Abs(ROC(V,1,$)),0),LastValue(Q))))));

RS:=Z/Y;
100-(100/(1+RS))

Equis Support
http://www.equis.com/
http://www.equis.com/customer/support/
Please include previous email answers and questions in your response. 

Equis and MetaStock and MetaStock Professional are registered trademarks
of Equis International.  Achelis Binary Wave, The DownLoader, Expert
Advisor, OptionScope, Quotecenter, and Smart Charts are trademarks of
Equis International.



-----Original Message-----
From: UG [mailto:ug@xxxxxxxxxxxx]
Sent: Monday, November 02, 1998 12:07 PM
To: metastock@xxxxxxxxxxxxx; Heidi Stubner
Subject: Re: Relative Strength Index


Heidi Stubner writes:

> I'm trying to calculate how Equis comes up with the RSI figures.  I've
> tried using the formula in the manual (100-(100/1+U/D)) where U =
> change of up days/time period and D= change in down days/time period.

I thought the U and D were the <period> day exponential MA of the ups or
downs.  I have the book, but alas, it's at home.  I can check it this
evening.

-- 
========================================================================
How many SysAdmins does it take to screw in a lightbulb? None. They
deny privileges to everyone with access to that room.
http://www.unixgeek.com/cgi-bin/motd.pl - PGP email preferred