Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 08-22-2008, 06:40 PM   #1

Join Date: Aug 2008
Posts: 12
Ignore this user

Thanks: 2
Thanked 0 Times in 0 Posts

Wanted: ZLEMA for TradeStation

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_kevi...g-Average.html
user237509837 is offline  
Reply With Quote
Old 08-23-2008, 10:47 PM   #2

Join Date: Feb 2007
Location: US
Posts: 314
Ignore this user

Thanks: 86
Thanked 206 Times in 89 Posts

Re: Wanted: ZLEMA for TradeStation

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.
thrunner is offline  
Reply With Quote
The Following User Says Thank You to thrunner For This Useful Post:
Tams (02-13-2009)
Old 08-24-2008, 01:50 AM   #3

Join Date: Nov 2006
Location: N/A
Posts: 612
Ignore this user

Thanks: 62
Thanked 294 Times in 177 Posts

Re: Wanted: ZLEMA for TradeStation

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

Code:
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.
Attached Thumbnails
Wanted: ZLEMA for TradeStation-zlema.png   Wanted: ZLEMA for TradeStation-zlema-hull.png  
sevensa is offline  
Reply With Quote
The Following User Says Thank You to sevensa For This Useful Post:
Tams (02-13-2009)
Old 08-26-2010, 03:11 AM   #4

Derry Brown's Avatar

Join Date: Feb 2010
Location: Auckland
Posts: 2
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Wanted: ZLEMA for TradeStation

I am a little confused. What is Price.X?

Is it Price * X? Or Price X periods ago?

Thanks for your help
Derry
Derry Brown is offline  
Reply With Quote
Old 10-26-2010, 01:07 AM   #5

Join Date: Jul 2010
Posts: 60
Ignore this user

Thanks: 13
Thanked 15 Times in 13 Posts

Re: Wanted: ZLEMA for TradeStation

HI,

Price[X] Refers to Price X bars ago.

EasyTrader_I
EasyTrader_I is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mark Fishers "ACD Trading Method", Seminar Videos Wanted. Szymon Technical Analysis 94 04-18-2012 11:54 AM
First Post, New Trader, Help Wanted! NickTW Beginners Forum 13 04-05-2008 11:19 AM
Wanted: Book Analyzing Bar Charts for Profit Sledge Technical Analysis 2 02-27-2008 02:14 PM
Just wanted to announce again... AbeSmith General Discussion 2 12-03-2007 08:28 PM
Tradestation TinGull Brokers and Data Feeds 9 01-11-2007 03:29 PM

All times are GMT -4. The time now is 09:59 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.