WhitmanTrading

Simple Moving Average: Half a Period Behind

A simple moving average is the arithmetic mean of the last N closing prices, recalculated on every new bar. Because all N bars carry equal weight, the average age of the data inside it is half the period, which is exactly how far behind price the line sits.

How it works

A candlestick chart of the site's shared price history. The headline on the chart reads: The mean of the last N closes, plotted.
The mean of the last N closes, plotted. Illustrative chart - not real market data.

Add up the last twenty closing prices, divide by twenty, and plot the result. Do it again on the next bar with a window shifted forward by one. That line is the simple moving average, and there is nothing else in it.

The word “simple” is doing real work. It distinguishes this from the weighted versions, and what it means is that every bar inside the window contributes exactly the same amount. The close from twenty bars ago is as important as today’s.

A calmly advancing stretch of the long price series. The headline on the chart reads: Every bar in the window counts exactly the same.
Every bar in the window counts exactly the same. Illustrative chart - not real market data.

That single design choice produces every property the line has — good and bad — and most pages about moving averages never mention it.

The lag is the arithmetic, not a defect

A gently rising stretch of the long price series. The headline on the chart reads: The line sits half the period behind price.
The line sits half the period behind price. Illustrative chart - not real market data.

Ask where the “centre of mass” of the window sits. With equal weights across twenty bars, the average age of the data in the line is 9.5 bars. In a steadily rising market the average is therefore sitting where price was about ten bars ago.

That is not an imperfection to be engineered away. It is what an average of past prices is. Any line built from the last twenty closes is a statement about the last twenty closes, and the middle of that window is nine and a half bars back whatever you do to the formula.

Which is why “is it lagging?” is the wrong question and “how much lag am I buying?” is the right one. The number is computable in advance: roughly half the period for this kind of average. A 50-period average is centred about 24 bars behind. A 200-period average is centred about 100.

A strongly rising stretch of the long price series. The headline on the chart reads: A longer period is a smoother line and a later one.
A longer period is a smoother line and a later one. Illustrative chart - not real market data.

So the period setting is a single dial with smoothness at one end and timeliness at the other. There is no setting that gives both, and a page recommending one specific number without saying what it is trading away is not telling you what the number does.

The drop-off effect almost nobody explains

A flat but volatile stretch of the long price series. The headline on the chart reads: And the oldest bar leaving moves it on its own.
And the oldest bar leaving moves it on its own. Illustrative chart - not real market data.

Each new bar does two things to the average: it adds a value and it removes one. The line can therefore move meaningfully on a day when price barely moved at all, purely because the bar dropping out of the back of the window was unusual.

This is specific to the equal-weight design. An exponential moving average never drops a bar out — it fades it — so it has no equivalent event. A simple average has a hard edge, and that edge is a real source of movement that has nothing to do with what is happening now.

Practically: if a simple average turns and you cannot see why on the right-hand side of the chart, look at the left-hand edge of its window. That is often the whole story.

In practice: what it is genuinely useful for

A flat, quiet stretch of the long price series. The headline on the chart reads: The slope says more than the crossing does.
The slope says more than the crossing does. Illustrative chart - not real market data.

The slope is the honest reading. Rising, falling or flat is a summary of the last N bars that your eye cannot produce reliably on its own, and it is available at a glance. That is a genuine service.

The crossing is the weaker reading, because price crosses an average constantly and most crossings mean nothing. Moving average crossover covers what happens when you trade them: on this site’s shared 576-bar history, a 20/50 pair crosses 18 times and a 5/10 pair crosses 57 times, which is 57 decisions on the same data.

A long-horizon candlestick view of the same price series. The headline on the chart reads: The two hundred is watched because it is watched.
The two hundred is watched because it is watched. Illustrative chart - not real market data.

The 200-period average is a special case, and the reason is not statistical. It is watched by enough people, quoted in enough headlines and coded into enough systems that price reaching it produces real behaviour. That is a self-fulfilling effect and it is the one honest argument for a specific setting. It is not that 200 measures something 180 does not.

A candlestick chart with a volume histogram beneath it, with the volume histogram emphasised. The headline on the chart reads: It ignores volume entirely, by construction.
It ignores volume entirely, by construction. Illustrative chart - not real market data.

It sees no volume at all. A bar that traded a thousand contracts and a bar that traded four count identically. If you want participation in the average, that is the volume-weighted version, and it is a different tool.

A candlestick series containing several opening gaps, with the largest opening gap marked. The headline on the chart reads: An opening gap drags it with nothing trading.
An opening gap drags it with nothing trading. Illustrative chart - not real market data.

A gap drags the line without a single trade inside the gap. The close is the close; the average does not know the market was shut. On instruments that gap regularly this produces lines that jump in ways nobody’s mental model of “a smooth average” predicts.

A declining stretch of the long price series, with the entry price and the level at which a stop would trigger drawn as horizontal lines. The headline on the chart reads: A stop at the line is a stop where everyone else is.
A stop at the line is a stop where everyone else is. Illustrative chart - not real market data.

Placing a stop at the average puts it at a price a great many people can compute exactly. That cuts both ways: the level attracts genuine reaction, and it also sits where resting orders cluster, which is precisely the sort of place price reaches for.

A candlestick chart of the site's shared price history, annotated with the round-trip cost. The headline on the chart reads: And each cross traded costs a share of a bar.
And each cross traded costs a share of a bar. Illustrative chart - not real market data.

Every crossing you act on costs 2% of a typical bar’s range in round-trip costs on this history. Eighteen 20/50 crosses is a small bill; fifty-seven 5/10 crosses is three times the same bill for the same underlying moves.

A 72-bar candlestick section of the shared price history. The headline on the chart reads: Nothing in the order book knows the line is there.
Nothing in the order book knows the line is there. Illustrative chart - not real market data.

And nothing in the order book is aware of it. The average is drawn by your platform from prices that already happened. Whatever reaction occurs at the line comes from other people drawing the same line, not from the line itself.

What a simple moving average is not

It is not a prediction. It is a summary of bars that have already closed, and it contains no statement about the next one.

It is not support or resistance in the structural sense. Support and resistance describes a price where trading actually happened. An average is a computed value that moves every bar, and price “respecting” it is a much weaker claim than price respecting a level it visibly turned at three times.

It is not made better by a longer period. Longer is smoother and later. Those are the same adjustment described twice.

And it is not independent of other averages. Two averages on one chart are two summaries of the same closes, which is the whole subject of the confluence page.

When it fails

A sideways, range-bound candlestick series. The headline on the chart reads: In a range it sits in the middle and is crossed constantly.
In a range it sits in the middle and is crossed constantly. Illustrative chart - not real market data.

A range is where it does the most damage. Price oscillates around the mean, so the mean sits in the middle and gets crossed on almost every leg. Every crossing looks like a signal and none of them is one, and this single regime accounts for most of the money lost to averages.

The second failure is the period hunt. Testing 18, 19, 20, 21 and 22 on past data and keeping the best one is fitting a parameter to noise. The differences between adjacent periods are far smaller than the differences between market regimes.

A third is treating the line as a level. It moves every bar. A stop “at the average” is at a different price tomorrow, which makes risk on the position a moving target rather than a decision.

A fourth is switching period after a loss. The average did not fail; the market changed regime. A new period will work well in the regime that just ended and badly in the next one.

And a fifth is stacking several of them and calling it analysis. A ribbon of ten averages is ten views of one price series. It looks like ten pieces of evidence and it is one.

The original data

On this site’s shared 576-bar history, price closed above its own 200-period simple average on 80% of the 377 bars where that average exists. That single figure reframes the “price is above the 200” observation completely: in a market that trends upward over the sample, being above the long average is the ordinary state, not a signal.

A 72-bar window of the shared price history, cut short at the decision bar. The headline on the chart reads: One percent under the two hundred. Buy or wait?
One percent under the two hundred. Buy or wait? Illustrative chart - not real market data.

The other measured figure is the crossing count, recorded in research/series-measurements.json alongside it: 57 crosses for a 5/10 pair, 18 for a 20/50, 3 for a 50/200, all on the same 576 bars. Run that count on your own instrument before you choose a period. It takes ten lines of code, and it tells you how many decisions the setting is going to hand you per year — which is the number that actually determines what the tool costs you.

Moving average is the parent page covering the family as a whole. Exponential moving average is the alternative weighting, and the comparison is more interesting than it is usually made to sound. And moving average crossover is what most people actually do with two of these lines.

What I actually do

I spent a long time hunting for the right period, as though one of them was correct and the rest were wrong. What I was really choosing was how late I wanted to be told, and once I saw it that way the question got much smaller and much easier to answer.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.