Exponential Moving Average (EMA)
Returns the Exponential Moving Average, which gives more weight to recent prices compared to older prices. EMA reacts more quickly to price changes than SMA.
EMA vs SMA
| Feature | EMA | SMA |
|---|---|---|
| Weighting | More weight to recent prices | Equal weight to all prices |
| Responsiveness | Faster response to changes | Slower, smoother |
| Lag | Less lag | More lag |
| Use case | Short-term trading | Long-term trends |
Common EMA Periods
| Period | Usage |
|---|---|
| 9-day | Very short-term |
| 12-day | MACD component |
| 20-day | Short-term trend |
| 26-day | MACD component |
| 50-day | Medium-term trend |
Parameters
| Parameter | Description | Default |
|---|---|---|
| Symbol | Stock ticker symbol | Required |
| Days | Number of periods for average | 30 |
| StartDate | Calculate EMA as of this date | Today |
Syntax
=ExponentialMovingAverage(Symbol, [Days], [StartDate])Parameters
Stock ticker symbol
Number of periods for EMA calculation
Start date for calculation (defaults to today)
Returns
Exponential moving average price
Examples
=ExponentialMovingAverage("AAPL")=ExponentialMovingAverage("AAPL", "12")=ExponentialMovingAverage("MSFT", "26")=ExponentialMovingAverage("SPY", "9")=ExponentialMovingAverage("AAPL", "20", DATE(2024,1,15))=ExponentialMovingAverage(A1, B1)When to Use
- Short-term trading strategies requiring quick signals
- MACD calculations (12-day and 26-day EMAs)
- Identifying recent trend changes
- Trading systems that need responsive indicators
- Crossover strategies with faster signals
When NOT to Use
| Scenario | Use Instead |
|---|---|
| Need smoother trend line | SimpleMovingAverage() |
| Long-term trend analysis | SimpleMovingAverage() with 200 days |
| Need momentum oscillator | RelativeStrengthIndex() |
| Need volatility measure | StandardDeviationOnClosePrice() |
Common Issues & FAQ
Why is EMA returning "NA"?
Check that:
- The symbol is valid and actively traded
- There is sufficient historical data
- The stock has been trading for at least the number of days requested
What period should I use?
Common periods:
- 9-12 days for very short-term trading
- 20-26 days for short-term analysis
- 50 days for medium-term
How is EMA calculated?
EMA = (Close - Previous EMA) * Multiplier + Previous EMA Where Multiplier = 2 / (Days + 1)
Excel Templates Using Exponential Moving Average (EMA)
These ready-made MarketXLS templates call ExponentialMovingAverage() in their worksheet formulas. Open one to see the function working inside a complete model.
Related Formulas
More MarketXLS Technical Indicators formulas you can use in the same worksheet:
- Fifty Day Moving Average
- Mid Point Over Period
- Minus Directional Indicator (-DI)
- Momentum
- Money Flow Index (MFI)
- On Balance Volume
- Percent Change From 200-Day Moving Average
- Percent Change From 50 Day Moving Average
See ExponentialMovingAverage used in a complete workbook: moving average excel: build an SMA and EMA crossover dashboard that updates itself
