logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
HKguy  
#1 Posted : Saturday, April 19, 2008 4:31:43 AM(UTC)
HKguy

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/9/2008(UTC)
Posts: 3

Hello,

I am new to metastock, (got it about a month ago). I have been slowly but surely trying to match the results for the "Simple Exponential Crossover System" on Ed Seykota's Trading Tribe website.

http://www.seykota.com/tribe/TSP/EA/index.htm

I have converted the S&P data from Excel into Metastock format. And I have worked around the null bar issue for the exponential averages using the following formula:

prd:=15;
data:=CLOSE;
m:=2/(prd+1);
ema:=If(Cum(IsDefined(data))=1,data,(m*data)+((1-m)*PREV));
{plot}
ema;

I'm also having trouble matching the ATR (it's a 20 day exponential lag, much like the above formula, but I can't get it to match). And I'm going crazy with the system tester as it's supposed to issue a Buy signal when the 15 day Exponential average crosses the 150 day Exponential average, and vice versa for the Sell signal, but it executes the first trade 2 days early for some reason.

Any bit of help on how to code this system properly would be GREATLY appreciated. It's a simple system, but I'm pulling my hair out trying to match it.

Thanks in advance.

pumrysh  
#2 Posted : Saturday, April 19, 2008 7:52:35 PM(UTC)
pumrysh

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/28/2004(UTC)
Posts: 110

HKguy,

Here's the ema formula which I believe was written by Roy Larsen:

{Exponential Moving Average}
N:=Input("Periods",1,99,10);
R:=2/(N+1); {ratio of new data added each bar}
X:=If(Cum(1)=1,C,PREV*(1-R)+C*R);
ValueWhen(1,Cum(1)>=N,X);

It plots exactly as the metastock formula. The last line limits the output until enough data is available for calculation. Results before this can be obtained by changing the last line to simply X but the output would not be correct.

When using ema based formulas in the system tester make sure that you have more than enough data loaded in order to get accurate results. Since you are looking for 150 days try to use at least 1K bars of data.

Hope this helps,

Preston

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.