Exponential Moving Average (EMA)

From FxCodeBaseWiki
Jump to: navigation, search

Formula

The classic EMA formula is:

<math> \operatorname{EMA}(price, N)_i = \alpha \times price_{i} + (1 - \alpha) \times \operatorname{EMA}(price, N)_{i-1} </math>

where

<math> \alpha = \dfrac {2} {N + 1} </math>

Unlike Simple Moving Average, where the weight of all previous bars is equal, the Exponential Moving Average makes the most recent bar more important. The weight of each older bar decreases the exponentially. Below is a weight chart for N = 10 (1 is the current price, 2 the previous and so on):

Ema1.png

The weight formula is

<math> \operatorname{weight}_{i} = \alpha \times (1 - \alpha) ^ {i} </math>

where i is a distance to the most recent bar. 0 means the most recent, 1 the previous bar and so on.

First Value

The formula references to the previous value and there is no standard agreement what is the first (oldest) value. Different implementation of EMA uses:

  • The first price (MT4, Marketscope)
or

Usage

In Place Of Simple Moving Average

The Exponential Moving Average may be used exactly as Simple Moving Average, especially in the situation when the inertness of Simple Moving Average is cannot be ignored. Just compare EMA(10) and MVA(10) applied on the same prices:

Ema2.png

Limitations

The Exponential Moving Average is based all its previous values, so, the indicator result for a particular bar depends on how much historical data is taken into account. So, in the situation when more historical data is loaded, the value of the indicator may differ from the previously calculated.

See Also

Indicators

Articles

This Article in Other Languages

Language: English  • español • français • русский • 中文 • 中文(繁體)‎