log in     sign up for free
 
There are a lot of problems to solve with exits. If the worst case does not happen (i.e., so you don't get stopped out), then the job of your system is to allow you to make the most profit possible and give the least amount of it back. Only your exits do this!
Van K. Tharp
 
 
Home
systems (285)
 
 
Special offer: buy MetaStock (try for free)   |   Reuters QuoteCenter Real-Time Data (get a free month)   |   EOD Data
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Nonlinear Ehlers Filter

Formula for: TradeStation

indicator

 

 

Views:  2135

Added: July 17, 2008
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: TradeStation, indicator
 


Here is some EasyLanguage code I developed to compute the filters presented in my article in this issue, "Nonlinear Ehlers Filters."


This exemplary filter has 15 coefficients ["Length(15)"], although the array of coefficients is dimensioned to 25 ["Coef[25]"] to allow experimentation using a longer filter. If you want a filter longer than 25, the dimension of the Coef array must be increased accordingly.
In the first calculation, you find each coefficient in the filter as the five-bar momentum. The next computation is to sum the numerator ["NUM"] as the product of each coefficient and the price (the x's in the general equation) at each corresponding sample, and then sum the coefficients alone. Finally, the filter is completed by taking the ratio of the numerator to the coefficient sum. The performance of this filter is shown in Figure 2 in the article.

If you'd rather use a spreadsheet, an example done in Microsoft Excel is shown in Figure 1.

FIGURE 1: EXCEL SPREADSHEET. Starting from the prices on the left, here is a way to compute a nonlinear Ehlers filter using a five-day momentum as the embedded filter.

--John Ehlers

The EasyLanguage for both the function and indicator will be available for download at www.tradestation.com. Look for the file "EhlersFilter.ELS."

-- Ramesh Dhingra, Product Manager, EasyLanguage

TradeStation Technologies, Inc. (formerly Omega Research, Inc.)
A wholly owned subsidiary of TradeStation Group, Inc.
http://www.TradeStation.com

 

 



Code:

Type : Indicator, Name : Nonlinear Ehlers Filter
Inputs: Price((H+L)/2), Length(15);
Vars: count(0), SumCoef(0), Num(0), Filt(0);
Array: Coef[25](0);

{Coefficients can be computed using any statistic of choice ----
---- a five-bar momentum is used as an example}

For count = 0 to Length - 1 begin
Coef[count] = AbsValue(Price[count] - Price[Count + 5]);
{The line above is all that needs to be changed to use other statistics.
For example: Coef[count]=AbsValue(Price[count]-Filt[count+1]);}
end;

{Sum across the numerator and across all coefficients}
Num = 0;
SumCoef =0;

For count = 0 to Length -1 begin
Num = Num + Coef[count]*Price[count];
SumCoef = SumCoef + Coef[count];
end;

Filt = Num / SumCoef;

Plot1(Filt, "Ehlers");

 





Code to difficult? Find somebody to help you with coding here.

 



Author: John Ehlers
Source: http://www.traders.com

 

View similar (indicator for TradeStation):

DBS-Break
Optimal Tracking Filter
Measure Cycle Period
Buff Averages
Pivot Bar
SaittaTrend
VIDYA
TrendArea_2 Indicator
SMI_TRADE Indicator (Stochastic Momentum Index Trade)
Hilbert Channel Indicator
...
 
 
all formulas for TradeStation
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
PayPalSecure payments by PayPal S4T™ is a part of TAURO EDUCATION NETWORK
 
Privacy note | (c) copyrights systems4trading.com 2006-2009