Returns the Exponential Moving Average, based on the last value of the series, the new value, and the number of days in the moving average.

 

A calculated indicator could be defined as follows. This would be the moving average of today's close minus yesterday's close, where the name of this calculated indicator is "closeChangeMovingAverage", and the number of days in the moving average is "daysInMovingAverage".  Or more simply, the 10 day exponential moving average of the close would be defined as follows, where closeEMA is a series variable.

Syntax:

value = EMA( lastValueOfSeries, movingAverageDays, newValue )

 

Parameter:

Description:

lastValueOfSeries

Previous value in the series

movingAverageDays

Number of days in the moving average

newValue

New data value to include in EMA series.

 

Example:

'  Example Name References
'  EMA( closeChangeMovingAverage[1], _
'       daysInMovingAverage, _
'       instrument.close - instrument.close[1] )
closeEMA = EMA( closeEMA[1], 10, instrument.close )

Returns:

Current EMA value after the data value included.

 

Links:

Average

See Also:

Mathematical Functions

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 273

 

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