Chapter 26 · Moving Averages
Moving averages
SMA, EMA, WMA, VWMA and HMA — the formulas, worked on the same closes, with the lag quantified.
A moving average against price
A moving average replaces each close with an average of the last n closes. It removes short-term movement so a direction is visible. Everything it gains in smoothness it pays for in lag, and the whole art is choosing where on that trade-off to sit.
The formulas
| Type | Formula | Character |
|---|---|---|
| SMA | (P₁ + P₂ + … + Pₙ) ÷ n | Every close weighted equally |
| EMA | EMAtoday = (Price × k) + (EMAyesterday × (1 − k)), where k = 2 ÷ (n + 1) | Recent closes weighted more; nothing ever fully drops out |
| WMA | Σ(Pᵢ × wᵢ) ÷ Σwᵢ, with weights 1, 2, … n | Linear decline in weight |
| VWMA | Σ(Price × Volume) ÷ Σ Volume | Weighted by how much traded, not by when |
| HMA | WMA over √n of (2 × WMA(n/2) − WMA(n)) | Built to cut lag while staying smooth |
| Golden cross | A short MA crossing above a long MA | Conventional bullish signal |
| Death cross | A short MA crossing below a long MA | Conventional bearish signal |
Worked: SMA and EMA on the same numbers
Five closes: 410, 414, 409, 421, 426.
- SMA(5) = (410 + 414 + 409 + 421 + 426) ÷ 5 = 2,080 ÷ 5 = 416.0.
- Seed the EMA with that same 416.0, and take k = 2 ÷ (5 + 1) = 0.3333.
A sixth close arrives at 433.
| Calculation | Result | |
|---|---|---|
| SMA(5) | (414 + 409 + 421 + 426 + 433) ÷ 5 | 420.6 |
| EMA(5) | (433 × 0.3333) + (416.0 × 0.6667) | 421.7 |
The EMA is higher because it gives the new close a third of the weight. The SMA gives it a fifth and drops the oldest close entirely — which is a real effect people forget: an SMA can fall on a day the price rises, purely because the number leaving the window was large.
Lag, quantified
An SMA of n periods is centred roughly (n − 1) ÷ 2 periods in the past. A 200-day average is describing where the middle of the last 200 days sat — about 100 days ago. A 20-day average lags by about 10 days.
That is not a defect to be engineered away. It is what smoothing means. Every low-lag average — HMA, DEMA, TEMA, Kaufman's adaptive average — buys responsiveness by giving up smoothness, and therefore whipsaws more. There is no free version.
Which length, for which job
| Setting | Common use | The question it answers |
|---|---|---|
| 200-day SMA | Primary trend filter | Is the long-term trend up? |
| 50-day SMA | Intermediate trend filter | Is the medium-term trend up? |
| 20-day EMA | Dynamic support in a strong move | Where do pullbacks tend to stop? |
| 10-day EMA | Short-term momentum | Is the current push still intact? |
| 50 / 200 pair | Golden and death crosses | Has the regime changed? |
| Ribbon (several at once) | Compression and expansion | Is the market undecided or committed? |
Golden cross and death cross
What a golden cross really is
A 50-day average cannot cross above a 200-day average until 50 days of closes have already risen enough to drag it there. By construction, the cross arrives well after the turn. It is a confirmation that a regime changed, not a forecast that one is about to. Anyone selling it as an entry signal is selling you the tail of a move.
Saved in this browser only — there is no account to create. Clearing your browser data clears your progress.
