PureBytes Links
Trading Reference Links
|
Glen,
Looks like you did some good work! I had worked on this some.....but
ended-up making an oscillator out of it (subtracting the ema from the rta).
If you wish to try "tuning" it in MetaStock, you could try different entry
levels
from the oscillator....for example go long when TOSC crosses from below -2,
or Short when crosses from above +2. Anywise here is the code I came up with
if you wish to compare them to each other:
{TOSC}
Lb:=Input("Look-Back Period?",3,100,21);
Ty:=Input("1=C 2=H 3=L 4= Median Price",1,4,1);
Tv:=If(Ty=1,C,If(Ty=2,H,If(Ty=3,L,MP())));
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,Tv,PREV))+Tv;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,Tv,PREV))+
(Alpha*(Tv+Bot-Ref(Bot,-1)));
TOSC:=RMTA-Mov(Tv,lb,E);
TOSC;
NOTE: this code will work slowly because of all of the "PREV" functions.
Best wishes,
Adam Hefner.
VonHef@xxxxxxxxxxxxx
---------------------------------------
----- Original Message -----
From: Glen Wallace <gcwallace@xxxxxxxx>
To: MetaStock listserver <metastock@xxxxxxxxxxxxxxxxxx>
Sent: Saturday, May 08, 1999 8:44 PM
Subject: Recursive Moving Trendline system
> Several months ago I adapted the Recursive Moving Trendline system
described
> in the Dec98 issue of Technical Analysis of Stocks & Commodities to a
> MetaStock system. I don't recall if anyone has posted the code and I have
> been meaning to bring it up. In any case, I would be happy to share it if
> anyone is interested.
>
> The system is basically a moving average crossover system used to identify
> changes in trends. It compares a Recursive Moving Trendline (which
attempts
> to predict tomorrow's price using an exponential moving average slope
> calculation) to an Exponential Moving Average of the price plot. A
> crossover of the two lines triggers a buy or sell signal. It might make a
> useful addition for those who use a linear regression-based system.
>
> Overall, it seems to identify trends and trend changes quite well, though
> with the weak money management capabilities of MetaStock, it is difficult
to
> fine tune the system to avoid whipsaws during retracements.
>
> I have attached a sample DJIA chart for the period from July to December.
> The green line is a 10-day RMT and the red is a 10-day EMA. In theory,
one
> buys when the green line crosses over the red, and sells when red crosses
> over green.
>
> Let me know if you want to try it out. My only condition (aye, therein
lies
> the rub) is that you share your insights and improvements --
particularly
> money management enhancements -- with the group.
>
> Regards.
>
>
>
>
|