Home
    Product
    Support
    Purchase
    Company

Advanced trading software: technical analysis and neural networks

Empowering wise traders

Support Center
Publications
Tradecision FAQs
Improvian Consulting
Contact Support Team
Knowledgebase
Collection of Indicators
Custom Indicators
Custom Studies
TASC Traders' Tips
Active Trader Strategies
Golden Trading Rules
Traderís Quiz

Traders' Tips from TASC Magazine
Zero Lag (Well, Almost)

In their article ďZero Lag (Well, Almost)Ē, John Ehlers and Ric Way have investigated how to remove a selected amount of lag from an exponential moving average and use the filter in an effective trading strategy.

Using Tradecisionís Indicator Builder, one needs to create the ZERO_LAG indicator:

ZERO_LAG indicator:

ins
Length : "Enter Period",20;
GainLimit:"Enter Gain Limit",50;
end_ins

var
alpha:=0;
Gain:=0;
BestGain:=0;
EC:=0;
Error:=0;
LeastError:=0;
EMA:=0;
Value1:=0;
end_var

if HistorySize < 1 then return c;
alpha:=2 / (Length + 1);
EMA:=alpha * Close + (1 - alpha) * EMA\1\;
LeastError:=1000000;
for Value1:= -GainLimit to GainLimit do begin
	Gain:=Value1 / 10;
	EC:=alpha * (EMA + Gain * (Close - EC\1\)) + 
    (1 - alpha) * EC\1\;
	Error:=Close - EC;
	if Abs(Error) < LeastError then
		begin
			LeastError:=Abs(Error);
			BestGain:=Gain;
		end;
end;
EC:=alpha * (EMA + BestGain * (Close - EC\1\)) + 
(1 - alpha) * EC\1\;

return EC;

Using Tradecisionís Strategy Builder, one needs to create the ZERO_LAG strategy:

ZERO_LAG strategy:

Long Rule:

var
Length := 20;
GainLimit:=50;
alpha:=0;
Gain:=0;
BestGain:=0;
EC:=0;
Error:=0;
LeastError:=0;
EMA:=0;
Value1:=0;
Thresh:=1;
end_var

if HistorySize < 1 then return false;
alpha:=2 / (Length + 1);
EMA:=alpha * Close + (1 - alpha) * EMA\1\;
LeastError:=1000000;
for Value1:= -GainLimit to GainLimit do begin
	Gain:=Value1 / 10;
	EC:=alpha * (EMA + Gain * (Close - EC\1\)) + 
    (1 - alpha) * EC\1\;
	Error:=Close - EC;
	if Abs(Error) < LeastError then
		begin
			LeastError:=Abs(Error);
			BestGain:=Gain;
		end;
end;
EC:=alpha * (EMA + BestGain * (Close - EC\1\)) + 
(1 - alpha) * EC\1\;


return CrossAbove(EC,EMA) and 100*LeastError / 
Close > Thresh;


Short Rule:

var
Length := 20;
GainLimit:=50;
alpha:=0;
Gain:=0;
BestGain:=0;
EC:=0;
Error:=0;
LeastError:=0;
EMA:=0;
Value1:=0;
Thresh:=1;
end_var

if HistorySize < 1 then return false;
alpha:=2 / (Length + 1);
EMA:=alpha * Close + (1 - alpha) * EMA\1\;
LeastError:=1000000;
for Value1:= -GainLimit to GainLimit do begin
	Gain:=Value1 / 10;
	EC:=alpha * (EMA + Gain * (Close - EC\1\)) + 
    (1 - alpha) * EC\1\;
	Error:=Close - EC;
	if Abs(Error) < LeastError then
		begin
			LeastError:=Abs(Error);
			BestGain:=Gain;
		end;
end;
EC:=alpha * (EMA + BestGain * (Close - EC\1\)) + 
(1 - alpha) * EC\1\;


return CrossBelow(EC,EMA) and 100*LeastError / 
Close > Thresh;



Download to import into Tradecision.

How to use this indicator in Tradecision:
  1. Click Download.
  2. Save this indicator in a safe location on your hard drive.
  3. Open Tradecision and in the Tools menu click Indicator Builder.
  4. In the Indicator Builder dialog, click Import, locate the saved file and then click OK.
The indicator will be added to the Custom Indicators list.
 
Zero Lag (Well, Almost)
Tradecision Reviews
Video Tours
Ask a question

Site Map   |   Terms of Use   |   Privacy Policy   |   Risk Warning
Forex, equities or futures trading involves substantial risk of loss and is not suitable for all investors.
Copyright © 2001-2017 Alyuda Research, LLC.  All rights reserved