Definition
A moving average is the average price over the most recent N periods, recalculated as each new period arrives so that the line smooths short-term noise. The simple moving average (SMA) weights every period equally, while the exponential moving average (EMA) weights recent prices more heavily.
How it works
Each value uses past data only, so a moving average always lags price: a longer window (such as 200 days) is smoother and slower than a shorter one (such as 20 days). The EMA reacts faster because its smoothing factor is α = 2 ÷ (N + 1); with N = 9, the latest price carries a weight of 20%.
Traders use averages to describe trend direction, as dynamic reference levels, and in crossover rules, where a short average crossing a long one changes the rule's stance. Windows such as 50 and 200 days are habits, not natural constants.
Formula / convention
SMA(N) = (P1 + P2 + … + PN) ÷ N; EMA(t) = α × Price(t) + (1 − α) × EMA(t − 1), where α = 2 ÷ (N + 1)
Illustrative example
Illustrative: a fictional share closes at 100, 102, 101, 105 and 107 over five days, so the 5-day SMA is 515 ÷ 5 = 103.0. If the next close is 109, the oldest price (100) drops out and the SMA becomes (515 − 100 + 109) ÷ 5 = 524 ÷ 5 = 104.8.
What to watch for
Moving averages lag, so crossover rules tend to react after a move has begun and can produce repeated false signals (whipsaws) when price moves sideways, with each extra trade adding costs. A rule that looks good with one window length may not hold with another.