How to Calculate Moving Average
What is Moving Average?
A moving average smooths out short-term fluctuations in data by averaging values over a sliding window. Simple moving averages (SMA) and exponential moving averages (EMA) are core tools in financial analysis and signal processing.
Formula
Simple MA_n = (x₁ + x₂ + ... + xₙ) / n; Exponential: EMA = α × xₜ + (1−α) × EMAₜ₋₁
- x₁, x₂, ..., xₙ
- data points
- n
- window size (period)
- α
- smoothing factor — for exponential moving average
- MA_n
- moving average
Step-by-Step Guide
- 1SMA(n) = average of last n values
- 2EMA uses a weighting factor k = 2/(n+1)
- 3EMA(t) = value×k + EMA(t−1)×(1−k)
- 4EMA reacts faster to recent changes than SMA
Worked Examples
Input
Data: 10,12,14,13,15, window=3
Result
SMA: —,—,12,13,14
Input
EMA-3 same data
Result
Puts more weight on recent values
Frequently Asked Questions
What is the difference between simple and exponential moving average?
SMA: all n values weighted equally. EMA: recent values weighted more heavily, responsive to changes.
How do I choose the window size n?
Larger n smooths more (less noise, less responsive). Smaller n is more responsive but noisier. Use domain knowledge.
Is moving average used for forecasting?
MA smooths historical data and can suggest trends, but it's backward-looking. ARIMA and other methods forecast better.
Ready to calculate? Try the free Moving Average Calculator
Try it yourself →