Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

user237509837

Wanted: ZLEMA for TradeStation

Recommended Posts

Zero Lag Exponential Moving Average (ZLEMA) is part of SierraChart. Problem: I use TS and I don't have a clue on programming (EasyLanguage is the opposite for me).

 

I think this is better than HA because it doesn't overshoot.

 

Anyway, here is the formula and if any of you smart guys who use TS can create the ELD, we can all benefit. If it can have the same color code as HA (green up/red down) that would be really helpful

 

EMA = K * ( 2 * PRICE - PRICE.X) + (1 - K) * EMA.1

where...

K = 2 / (n + 1)

n = Period

x = lag = (n - 1) / 2

 

http://www.geocities.com/user42_kevin/chart/manual/Zero_002dLag-Exponential-Moving-Average.html

Share this post


Link to post
Share on other sites

Welcome to the forum.

 

What you have posted is based on the infinite impulse filter (IIF) described by John Ehlers in his 2002 article, "Zero-Lag Data Smoothers."

You can just copy and paste and verify the TS code portion in that Ehlers' article.

 

The Moving Average Triangular that is built into TS is another option if you can't get this to work.

Share this post


Link to post
Share on other sites

Here is the code based on your formula. Copy and paste into EL and verify.

 

Input:	Price(Close),
Period(13),
UpColor(Green),
DownColor(Red);

Vars:	K(0),
x(0),
EMA(0);

K = 2/(Period + 1);
x = (Period - 1)/2;

if CurrentBar = 1 then 
EMA = Price 
else
EMA = K * ( 2 * price - price[x]) + (1 - K) * EMA[1];

If EMA > EMA[1] then SetPlotColor(1,UpColor);
If EMA < EMA[1] then SetPlotColor(1,Downcolor);

Plot1(EMA, "ZLEMA");

 

Attached are two screenprints. In the first one the ZLEMA is in Red and Green. In the other one both the 13 period ZLEMA and Hull Averages are displayed. ZLEMA in Magenta and Hull in Yellow. From this comparison it appears that the ZLEMA overshoots more than Hull.

ZLEMA.thumb.png.26f0e7ff508661ce27a6af202c3334d6.png

5aa70e7e40be7_ZLEMAandHull.thumb.png.7e8c9e97f05390dd5bfa0e9a3d2017a3.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.