Adaptive exponential moving average.

 

The moving average adapts based on the distance between the moving average and the current price.

 

Syntax:

EhlersZeroLagEma( series, emaseries, bars, lastValueOfSeries )

 

Parameter:

Description:

series

The name of the series

emaseries

Normal exponential moving average (ema) series that was previously calculated. This ema should use the same period and is used as a starting point for adapting the moving average.

bars

The number of bars over which to find the moving average

lastValueOfSeries

The previous value in the series

 

Returns:

The zero lag exponential moving average.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Update Indicators Script
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  EZLEma = IPV numeric auto-index series
'  EmaClose = Built-In Indicator EMA Close - 21-bars
'  Bar_ Count = 21 - Parameter - Lookback enabled
'  Ehler's Zero Lag Ema - EmaClose = built-in Ema of Close
EZLEma = EhlersZeroLagEma( Instrument.Close, _
                          EmaClose, _
                          Bar_Count, _
                          EZLEma[1])
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Chart Display:

 

EhlersZeroLagEma_CT_21-Bar

 

Links:

EMA

 

 


 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software