THE GENIUS PROJECT
๐Ÿ“ˆ Model deep dive ยท Statistical model 1 of 3

The Moving Average

๐Ÿ•’ About 12 minutes ๐Ÿ“Š Real NCB data ๐ŸŽฎ 1 interactive
A price chart with smooth moving-average lines drawn over the candles

The moving average is the friendliest forecaster there is. Its whole idea: tomorrow will probably look like the recent few days, so just average them. Simple as it sounds, it is used every single day by real traders, and it is the perfect first tool for guessing your light bill too.

The one idea

A single day's price is jumpy. Somebody sells a big block of shares, a rumour spreads, and the number twitches. None of that tells you much about next week. So instead of trusting one noisy day, you take the average of the last few days and slide that window forward as new days arrive. That sliding average is the "moving" average.

Window how many days you average

The window is the number of recent days you blend together. A 3-day window reacts fast but stays jumpy. A 7-day window is smooth and calm but slow to notice a real turn. Choosing the window is the whole skill.

$$\text{forecast for tomorrow} = \dfrac{p_{\text{today}} + p_{\text{yesterday}} + \cdots}{\text{window size}}$$

Add up the last few closing prices, divide by how many you used. That average is your guess for the next day.

Play with the window

Below are NCB's real recent closing prices in teal. Drag the slider to change the window size and watch the gold moving-average line change shape. The gold star just past the end is the moving average's forecast for the next day.

How to use this
  1. Drag the window slider from 2 up to 8 days.
  2. Watch the gold line get smoother as the window grows, but also start to lag behind sharp turns.
  3. Read the backtest error: we replayed history and measured how far this window's forecast landed from the real next price. Lower is better.
3
Drag the slider to explore.
โœ‹ Check your understanding
You widen the window from 3 days to 8 days. What happens to the gold line?

What it is great at, and where it slips

๐Ÿ‘ Great for

Calm, slow-moving things like a monthly bill or a steady stock. It cuts through noise with almost no maths.

๐Ÿ‘Ž Slips when

The world turns sharply. Because it looks only backward, it always lags a real change and never predicts a brand-new spike.

๐Ÿ’ก Use it on your own light bill

Your JPS bill is far calmer than a stock, which makes the moving average a genuinely strong guess. Average your last three or four bills and you have a solid forecast for next month. You will do exactly this in the bonus light-bill challenge.

๐Ÿง  Recap
  • A moving average forecasts the next value as the average of the last few.
  • The window trades smoothness against lag: wider is calmer but slower.
  • It shines on calm series like bills, and lags on sharp turns.

Next: draw your own best-fit line through the prices with linear regression.