|
EMA Function |
Top Previous Next |
|
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.
Syntax
value= EMA( lastValueOfSeries, movingAverageDays, newValue )
Parameters
Examples
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."
EMA( closeChangeMovingAverage[1], daysInMovingAverage, instrument.close - instrument.close[1] )
Or more simply, the 10 day exponential moving average of the close would be defined as follows, where closeEMA is a series variable.
closeEMA = EMA( closeEMA[1], 10, instrument.close ) |