log in     sign up for free
 
When I became a winner I went from 'I figured it out, therefore it can't be wrong' to 'I figured it out, but if I'm wrong, I'm getting the hell out, because I want to save my money and go on to the next trade.'
Marty Schwartz
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time 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

Distance Coefficient Ehlers Filter

Formula for: TradeStation

indicator


 

 

Views:  1587

Added: February 01, 2007
 
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
 
Your Ad Here
Here is some EasyLanguage code I developed to compute the filters presented in my article in this issue, "Nonlinear Ehlers Filters."


Next is the EasyLanguage code to compute the distance coefficient Ehlers filter also presented in my article in this issue, "Nonlinear Ehlers Filters":

The TradeStation code for a distance coefficient can also be used in the nonlinear Ehlers filter. If you'd rather use a spreadsheet, an example of the TradeStation code for a distance coefficient can be seen in Excel form in Figure 2.


FIGURE 2: DISTANCE COEFFICIENT. This spreadsheet computes the squared difference between the current price and the price five bars back, and then squares it to get a more responsive Ehlers filter value.

MICROSOFT EXCEL

To compute the filter in Excel, first compute the squared differences from the current price as:

E7 = (D7-D6)^2+(D7-D5)^2+(D7-D4)^2+(D7-D3)^2+(D7-D2)^2

As soon as you have five values of the squared difference, compute, in F11:

F11 =D7*E7+D8*E8+D9*E9+D10*E10+D11*E11
Then,

G11 =SUM(E7:E11)

H11 =F11/G11

Copy all the row 11 values downward and check the values against those in Figure 2.

--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 : Distance Coefficient Ehlers Filter
<p>Inputs: Price((H+L)/2),<br>
Length(15); </p>
<p>Vars: count(0),<br>
LookBack(0),<br>
SumCoef(0),<br>
Num(0),<br>
Filt(0);</p>
<p>Array: Coef[25](0),<br>
Distance2[25](0);</p>
<p>For count = 0 to Length - 1 begin<br>
Distance2[count] = 0;<br>
For LookBack = 1 to Length begin<br>
Distance2[count] = Distance2[count] + (Price[count] - Price[count<br>
+ LookBack])*(Price[count] - Price[count + LookBack]);<br>
end;<br>
Coef[count] = Distance2[count];<br>
end;<br>
Num = 0;<br>
SumCoef =0;<br>
For count = 0 to Length -1 begin<br>
Num = Num + Coef[count]*Price[count];<br>
SumCoef = SumCoef + Coef[count];<br>
end;<br>
If SumCoef &lt;&gt; 0 then Filt = Num / SumCoef;</p>
<p>Plot1(Filt, &quot;Ehlers&quot;);</p>
<p></p>

 






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

 

View similar (indicator for TradeStation):

DBS-Break
Relative Vigor Index
Gap-Trading System
Trend Detection Index
Dunn's Density Indicator
SMI Oscillator
CCI - Stochastic (CCI-STO)
OBVDI w/ Avg
NLR Indicator
Volume Weighted Average Price - SMA
...
 
 
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.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012