log in     sign up for free
 
If you really think the stock is going to make a big move - and that should be the only reason you are buying the stock to begin with - then there is no reason to haggle over an eighth of a point. Just buy the stock.
David Ryan
 
 
Home
systems (284)
 
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

Ehlers Filter

Formula for: TradeStation

indicator


 

 

Views:  1934

Added: May 17, 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 a generic EasyLanguage version of the nonlinear Ehlers filter, based on John Ehlers's article in this issue, "Nonlinear Ehlers Filters." This EasyLanguage filter accepts the coefficients statistic as an input.
In the following EasyLanguage indicator code, the Coef input is set to AbsValue( MedianPrice - MedianPrice[5] ), and the price input is set to MedianPrice. MedianPrice is a built-in function in EasyLanguage that returns (H + L) / 2. With these values for the inputs, the indicator is equivalent to the momentum-based Ehlers filter, for which a specific EasyLanguage version has been developed by John Ehlers and is given at the top of this Traders' Tips section.

To derive the distance coefficient Ehlers filter, which is also described in Ehlers's article, the Coef input value in the following EasyLanguage can be replaced with DistanceSqrd( MedianPrice, 15 ). DistanceSqrd is a custom function, and the code for that follows the indicator code.

 

 



Code:

Type : Indicator, Name : Ehlers Filter

inputs:
Coef( AbsValue( MedianPrice - MedianPrice[5] ) ),
Price( MedianPrice ),
Length( 15 ) ;

variables:
Num( 0 ),
SumCoef( 0 ),
Count( 0 ),
Filt( 0 ) ;

Num = 0 ;
SumCoef = 0 ;

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

if SumCoef <> 0 then
Filt = Num / SumCoef ;

Plot1( Filt, "Ehlers" ) ;

Type : Function, Name : DistanceSqrd

inputs:
Price( numericseries ),
Length( numericsimple ) ;

variables:
DSqrd( 0 ),
LookBack( 0 ) ;

DSqrd = 0 ;
for LookBack = 1 to Length
begin
DSqrd = DSqrd + Square( Price - Price[LookBack] ) ;
end ;
DistanceSqrd = DSqrd ;


 






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

 

View similar (indicator for TradeStation):

Buy/Sell Pressure
Moving Average Adjuster
Alligator Indicators
Close From One Day To The Next
Keltner Bands
Symmetrical Shark Indicator
Bond Futures LR Surfing Indicator
Preferred (Slow) Oscillator
Klinger Volume Oscillator
Color on MACD Histogram
...
 
 
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