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

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............

e-mail: VonHef@itlnet.net
Source / From: TOP