log in     sign up for free
 
To be a money master, you must first be a self-master.
J. P. Morgan
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time Data
 

Buy

MetaStock

     (special offer)
 
 
 

Buy

EOD data for MetaStock

     (special offer)
 
 
 

Buy

Realtime data for MetaStock

     (special offer)
 
 
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Recursive Moving Trend Average

Formula for: MetaStock

indicator


 

 

Views:  1537

Added: December 14, 2007
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: MetaStock, indicator
 
Your Ad Here
Is the name of an article in the December issue of TASC, written by DennisMeyers. 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) RMTA:=(1-Alpha)*(If(Cum(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 I
Lb:=Input("Look-Back Period?",3,100,21);
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1) RMTA:=(1-Alpha)*(If(Cum(1) TOSC:=RMTA-Mov(C,lb,E);
TOSC;




Here is the code for System Testing:

Buy Long:

Lb:=opt1;
ent:=3;
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1) RMTA:=(1-Alpha)*(If(Cum(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) RMTA:=(1-Alpha)*(If(Cum(1) TOSC:=RMTA-Mov(C,lb,E);
Cross((0+Abs(ent)),tosc1)

Opt1 is the look- back periods, of 3 to 30, and
Opt2 is the entry value of the oscillator, 0 to 5.

Now, after all the hours spent on figuring out the code, I have discoveredthat
the RMTA plots very similar to the DEMA, oh well............
Adam Hefner.
e-mail: VonHef@itlnet.net


----- Original Message -----
From: Glen Wallace
To: MetaStock listserver
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.


Re: Recursive Moving Trendline system

·To:
·Subject: Re: Recursive Moving Trendline system
·From: "VonHef"
·Date: Sat, 8 May 1999 22:19:20 -0500
·Organization: Microsoft Corporation
·References: <01dd01be99bd$b83c97c0$5f1c4118@xxxxxxxxxxxxxxxxxxxxxx>
·Reply-To: metastock@xxxxxxxxxxxxx
·Sender: owner-metastock@xxxxxxxxxxxxx

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 Oscillator II
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) RMTA:=(1-Alpha)*(If(Cum(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

 

 



Code:



Recursive Moving Trend Average
Lb:=Input("Look-Back Period?",3,100,21);
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1) RMTA:=(1-Alpha)*(If(Cum(1) RMTA;






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





Buy Long:

Lb:=opt1;
ent:=3;
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1) RMTA:=(1-Alpha)*(If(Cum(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) RMTA:=(1-Alpha)*(If(Cum(1) TOSC:=RMTA-Mov(C,lb,E);
Cross((0+Abs(ent)),tosc1)




TOSC Oscillator II
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) RMTA:=(1-Alpha)*(If(Cum(1) TOSC:=RMTA-Mov(Tv,lb,E);
TOSC;






 






Author: Dennis Meyers
Source: http://www.guppytraders.com

 

View similar (indicator for MetaStock):

Volatility Stop by Chande & Kroll
Regression Oscillator & Slope/Close Indicator
Exponential Moving Average - Cycle-adaptive
ATR - True & Reverse
Kurtosis Indicator
Dahl Oscillator
Stochastic Oscillator Monthly EMA
Countback Line
Tick Line Momentum Oscillator
Gap Bar Counter
...
 
 
all formulas for MetaStock
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012