 # EMA - Exponential Moving Average

Updated: 2023-09-01 Unlike the SMA, the EMA gives more weight to recent data, making it quicker to respond to price changes.

## Calculating

### Formula

EMA = (Close - Previous EMA) * Multiplier + Previous EMA

Where:

• Close: the closing price for a given period (Price today/now). Here close prices is for example
• N: the period of the EMA.
• Multiplier: 2 / (N + 1)
• Previous EMA is the EMA of the previous period.

The EMA for the first period is just the Close price.

But for subsequent periods, it’s calculated as follows:

• EMA = (Close - Previous EMA) * Multiplier + Previous EMA
• EMA[i] = (Close[i] - EMA[i-1]) * 2/(N+1) + EMA[i-1]

However, the EMA’s calculation is slightly more complex for the initial period because there is no previous EMA. In this case, we use the SMA as the first EMA:

EMA(first period) = SMA


Example:

Let’s calculate a 5-minute EMA at Minute 6 with the following market data:

MinuteOpenHighLowCloseEMA
1$10.0$11.0$9.5$10.0-
2$10.1$12.1$10.0$12.0-
3$12.2$15.2$12.0$15.0-
4$15.1$15.1$13.9$14.0-
5$14.1$16.1$14.0$16.013.4(SMA)
6$16.1$16.1$14.9$15.015.67
7$15.1$17.1$15.0$17.0
8$17.1$17.1$15.9$16.0
9$16.1$18.1$16.0$18.0

Can be calculated from first price

Here, N = 5, so Multiplier = 2 / (5 + 1) = 0.33.

• SMA(5) = (10.0 + 12.0 + 15.0 + 14.0 + 16.0) / 5 = 13.4
• This value becomes the first EMA (EMA). Now, to calculate the EMA for the 6th minute, we use the EMA formula:
EMA = (Close - EMA) * multiplier + EMA
= (15.0 - 13.4) * 0.33 + 13.4
= 14.13


## Pros and Cons

Pros:

• More responsive: By giving more weight to recent prices, the EMA can adapt faster to price changes.
• Combines trend and momentum: The EMA not only captures the overall trend but also shows the asset’s momentum.
• Often used for High frequency trading.

Cons:

• More prone to false signals: The sensitivity of the EMA can sometimes lead to false signals, especially in volatile markets.
• Complex calculation: Compared to the SMA, the EMA’s calculation is slightly more complex, especially for longer periods.

## Example of signals

Like the SMA, traders often use two EMAs: a short-term one and a long-term one. When the short-term EMA crosses above the long-term EMA, it’s a bullish (buy) signal, and when it crosses below, it’s a bearish (sell) signal.

True Positive:

In minute 7, the short EMA crosses above the long EMA, which is a buy signal. The price then goes up, confirming this was a correct signal.

In a stable uptrend, the short-term EMA might cross above the long-term EMA, correctly suggesting that it’s a good time to enter a long position.

False Positive:

In minute 11, the short EMA dips below the long EMA, suggesting a sell signal. However, the price increases in the next minute, making this a false signal.

In a volatile market, the price might swing up and down sharply, causing the short-term EMA to cross the long-term EMA back and forth, generating multiple buy and sell signals that could be misleading.