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

Notification

Icon
Error

Options
Go to last post Go to first unread
kalos  
#1 Posted : Tuesday, October 19, 2010 4:21:07 AM(UTC)
kalos

Rank: Newbie

Groups: Registered, Registered Users
Joined: 10/19/2010(UTC)
Posts: 2

Hello, Stocks & Commodities magazine in November 2010 is the EasyLanguage formula (tradestation) for the Zero Lag EMA designed by John Ehlers and Ric Way with interesting features, someone can translate it in Metastock language?
tradestation code:
EASYLANGUAGE CODE FOR THE ZERO-LAG INDICATOR
Inputs:
	Length(20),
	GainLimit(50);

Vars:
	alpha(0),
	Gain(0),
	BestGain(0),
	EC(0),
	Error(0),
	LeastError(0),
	EMA(0);

alpha = 2 / (Length + 1);
EMA = alpha*Close + (1 - alpha)*EMA[1];
LeastError = 1000000;
For Value1 = -GainLimit to GainLimit Begin
	Gain = Value1 / 10;
	EC = alpha*(EMA + Gain*(Close - EC[1])) + (1 - alpha)*EC[1];
	Error = Close - EC;
	If AbsValue(Error) < LeastError Then Begin
		LeastError = AbsValue(Error);
		BestGain = Gain;
	End;
End;
EC = alpha*(EMA + BestGain*(Close - EC[1])) + (1 - alpha)*EC[1];

Plot1(EC);
Plot3(EMA);
EASYLANGUAGE FOR THE ZERO-LAG TRADING STRATEGY
Inputs:
	Length(20),
	GainLimit(50),
	Thresh(1);

Vars:
	alpha(0),
	Gain(0),
	BestGain(0),
	EC(0),
	Error(0),
	LeastError(0),
	EMA(0);

alpha = 2 / (Length + 1);
EMA = alpha*Close + (1 - alpha)*EMA[1];
LeastError = 1000000;
For Value1 = -GainLimit to GainLimit Begin
	Gain = Value1 / 10;
	EC = alpha*(EMA + Gain*(Close - EC[1])) + (1 - alpha)*EC[1];
	Error = Close - EC;
	If AbsValue(Error) < LeastError Then Begin
		LeastError = AbsValue(Error);
		BestGain = Gain;
	End;
End;
EC = alpha*(EMA + BestGain*(Close - EC[1])) + (1 - alpha)*EC[1];

If EC Crosses Over EMA and 100*LeastError / Close > Thresh Then Buy Next Bar on Open;
If EC Crosses Under EMA and 100*LeastError / Close > Thresh Then Sell Short Next Bar on Open;


Many Thanks
Laisze  
#2 Posted : Wednesday, October 20, 2010 3:06:06 PM(UTC)
Laisze

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/18/2007(UTC)
Posts: 96
Location: HK

The zero-lag for metastock is here at the VST site. It has signals as well!
kalos  
#3 Posted : Thursday, October 21, 2010 2:39:00 AM(UTC)
kalos

Rank: Newbie

Groups: Registered, Registered Users
Joined: 10/19/2010(UTC)
Posts: 2

Hi, in fact yesterday I was contacted privately Jose Silva and was kind enough to translate it. Jose is the best operating system developer metastock there in the world! Jose's website is full of technical tips ( www.metastocktools.com )
Many thanks

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.