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 #

Recursive Moving Trend Average by Dennis Meyers
Is the name of an article in the December issue of TASC, written by Dennis Meyers.
In it he describes what he calls "The Recursive Moving Trend Average". I wont go into all the article right now, but here is my translationof his math (for Metastock 6.5) :

Recursive Moving Trend Average

Lb:=Input("Look-Back Period?",3,100,21);
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*Abs(C+Bot-Ref(Bot,-1)));
RMTA;

 

He then explains how to make an oscillator by subtracting an Exponential MAform the Recursive MA...... again here is the code:

 


TOSC Oscillator

Lb:=Input("Look-Back Period?",3,100,21);
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*Abs(C+Bot-Ref(Bot,-1)));
TOSC:=RMTA-Mov(C,lb,E);
TOSC;

 

Here is the code for System Testing :

 


Recursive Moving Trend Average System Test

Buy Long:

Lb:=opt1;
ent:=3;
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+(Alpha*Abs(C+Bot-Ref(Bot,-1)));
TOSC:=RMTA-Mov(C,lb,E);
Cross(tosc,(0-Abs(ent)))

Sell short:

Lb:=opt1;
ent:=3;
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+(Alpha*Abs(C+Bot-Ref(Bot,-1)));
TOSC:=RMTA-Mov(C,lb,E);
Cross((0+Abs(ent)),tosc)

Opt1 is the look- back periods, of 3 to 30

 

 
Opt2 is the entry value of the oscillator, 0 to 5

Now, after all the hours spent on figuring out the code, I havediscoveredthat
the RMTA plots very similar to the DEMA, oh well............

Adam Hefner
e-mail: VonHef@itlnet.net
Source / From: TOP
http://www.guppytraders.com

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!