[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Theta model



PureBytes Links

Trading Reference Links



Hi there,

Some people have asked about the Theta model.  I have not used the
Theta in Metastock before, but made a quick and dirty implementation
of it which you will find below.  The Theta model decompose the series
into two components, a long and a short term one.  If you use monthly
data, then it has a third component, which is the seasonality, but I
think that will not apply to most series studied in Metastock.  In the
default Theta model implementation, you have theta = 0 (long term) and
theta = 2 (short term) and you fit an optimal exponential moving average
to the short term, but to do this in Metastock will be quite difficult.

The long term component can be interpreted as the long term or true
value of the market, say where the market is supposed to be based on
fundamentals.  The short term component is where the market finds
itself based on shorter term factors.  Thus the shorter term factors
pushing it away from the long term line.  The projection itself is
exactly midway between the long and short term lines.

Anyhow, we normally use both the short and the long term lines in
strategies, as well as extrapolate the theta line itself, which is
very easy to do (but difficult in Metastock).

Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://tsatsaeod.ferra4models.com
http://www.ferra4models.com

------------------- Theta model Metastock code follows

{MG's implementation of the Theta model

 This is not an exact implementation,
 it e.g. does not optimise the theta = 2
 weight, assumes a theta = 2 line (as is
 usually assumed, reducing the whole model
 to a linear fit and an exponential fit to
 the residuals for the theta = 0 and
 theta = 2 lines) and the theta = 0 is not
 really a straight line, but the last value
 of length amount of straight lines fitted
 to the data.  But the spirit of the model
 is the same as that of the real theta.

 This is actually a forecasting model, thus
 the theta line is a projection of where the
 price is supposed to go to.  To use in
 practise, take it as a type of moving average.
 Thus if the price cross it, buy as if the price
 just cross above a moving average and vice
 versa.

 MG Ferreira
 2005
 http://www.ferra4models.com
 http://tsatsaeod.ferra4models.com
}

{Length to use when fitting}
length:=Input("Length",5,1000,50);

{Theta long term line, assume theta=0, sort of...}
lt:=TSF(CLOSE,length);

{Theta short term, assume theta=2, sort of...}
rs:=CLOSE-lt;
st:=lt+2*Mov(rs,length,E);

{Theta}
(lt+st)/2









------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/