How to calculate an exponential moving average
Paste prices oldest-first, one value or row per bar — straight from a spreadsheet or CSV export. Use “Sample data” to try it instantly.
Worked example
- EMA(3): k = 2 ÷ 4 = 0.5. The first three closes 1, 2, 3 give a seed of 2.
- Next close 4: EMA = (4 − 2) × 0.5 + 2 = 3.
- Next close 5: EMA = (5 − 3) × 0.5 + 3 = 4.
How to interpret an exponential moving average
An EMA gives the most recent close a weight of k and lets older prices fade geometrically, so it turns faster than an SMA of the same length. EMAs are the building blocks of MACD; the 9, 20 and 50-period EMAs are common trend filters.
Limitations and common mistakes
- Because of the seed, early values differ slightly between platforms; they converge after a few multiples of n bars.
- Faster reaction also means more false signals in choppy markets.