What is the difference between Simple, Weighted, and Exponential Moving Averages?
A Simple Moving Average (SMA) gives equal weight to all data points in the period. A Weighted Moving Average (WMA) assigns higher weights to more recent data points within the window. An Exponential Moving Average (EMA) applies a smoothing factor α so that recent observations have exponentially more influence than older ones, making it more responsive to recent changes.
How do I choose the right period length?
Shorter periods (e.g. 3–5) react quickly to changes but can be noisy. Longer periods (e.g. 20–200) are smoother and better at revealing long-term trends but lag behind recent changes. Common choices include 10-day, 50-day, and 200-day MAs for financial data, or 3–12 month MAs for business forecasting.
How is the Simple Moving Average formula calculated?
For a period n, the SMA at position i is: SMA(i) = (Y(i-n+1) + Y(i-n+2) + ... + Y(i)) / n. For example, a 3-period SMA of the values 10, 20, 30, 40 gives: SMA(3) = (10+20+30)/3 = 20 and SMA(4) = (20+30+40)/3 = 30. You might also find our calculate Trend Analysis Trend Direction useful.
What does it mean when the price curve crosses the moving average curve?
When the price crosses above the moving average it is often seen as a bullish signal, suggesting an upward trend may be starting. When the price crosses below the moving average it may signal a bearish trend. Traders use these crossover points as potential buy or sell signals.
How is the Exponential Moving Average (EMA) calculated?
EMA is computed with the formula: EMA(t) = α × Y(t) + (1 - α) × EMA(t-1), where α is the smoothing factor between 0 and 1. The first EMA value is typically seeded with the first data point. A higher α value makes the EMA more responsive to recent data, while a lower value produces a smoother line.
How to calculate a 200-day moving average?
A 200-day moving average is simply a Simple Moving Average with period n = 200. You sum the most recent 200 closing prices and divide by 200. As each new day's price arrives, the oldest price is dropped and the new one is added. This is widely used in financial markets to identify long-term price trends.
Why does the moving average have fewer values than the original data?
For an SMA or WMA with period n, the first MA value can only be computed once n data points have been collected, so the output has (total points − n + 1) values. For example, with 10 data points and a 3-period MA you get 8 MA values. EMA can technically start from the first point since it is seeded with the initial value.