MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Relative Strength Index - Custom III
----- Original Message -----
From: Glen Wallace <gcwallace@xxxxxxxx>
To: MetaStock listserver <metastock@xxxxxxxxxxxxxxxxxx>
Sent: July 31, 1999 13:43
Subject: Welles Wilder's Relative Strength Index (RSI)


The standard RSI function in MetaStock does not permit the use of a variable for the number of periods or for the price array, so I need to write thelong-hand version. Unfortunately, I'm having a brain fart when it comesto coding the sum of the absolute price changes on the up days (or down days)in a particular, user defined period. Does anyone have the code forthis, or can anyone suggest a solution?

RSI = 100 - (100 / (1+U/D))
Where: U = an average of upward price change on a closing basis
D = an average of downward price change on a closing basis


Re: Welles Wilder's Relative Strength Index (RSI)

To: <metastock@xxxxxxxxxxxxx>
Subject: Re: Welles Wilder's Relative Strength Index (RSI)
From: "Glen Wallace" <gcwallace@xxxxxxxx>
Date: Mon, 2 Aug 1999 14:40:46 -0700
References: <003001bedb96$0d041020$5f1c4118@xxxxxxxxxxxxxxxxxxxxxx>
Reply-To: metastock@xxxxxxxxxxxxx
Sender: owner-metastock@xxxxxxxxxxxxx

Thanks to everyone who offered solutions. Below is the code for anRSI where you can customize the number of periods (perhaps to increase ordecrease as volatility changes) and the price array (perhaps to a movingaverage of the close). Although I have not tested it thoroughly, whenI use similar parameters, it matches the standard MetaStock RSI function. Of course, if you spot any flaws or improvements, let me know.

Note that the parameters used in the example below have no value as an indicator; they're just for illustration.


Relative Strength Index - Custom III

RSIPeriod:= Int(14 / (Stdev(CLOSE,10)/Stdev(CLOSE,5)));
RSIDataArray:= Mov(CLOSE,25,SIMPLE);

U:= Wilders(If(ROC(RSIDataArray,1,$)>0,
ROC(RSIDataArray,1,$), 0),
LastValue(RSIPeriod));

D:= Wilders(If(ROC(RSIDataArray,1,$)<0,
Abs(ROC(RSIDataArray,1,$)), 0),
LastValue(RSIPeriod));

100-(100/(1+U/D))

 

Source / From: TOP
http://purebytes.com/archives/metastock/

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, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!