Guides · Updated

Moving average crossover: what it is and how to test it

A trend-following rule: own the investment while its recent average price is above its longer-run average, and step aside when it is below.

Open the moving average study →

The idea

A moving average is the average closing price over the last so many days. A 50-day average follows recent prices closely. A 200-day average moves slowly and shows the longer direction.

A crossover rule compares the two. When the short average climbs above the long one, prices have been rising faster lately than over the long run, and the rule buys. When it drops below, the rule sells and waits in cash.

A small example

Take round, made-up numbers. A fund has averaged $98 over the last 200 days and $101 over the last 50. The short average is above the long one, so the rule is invested. Prices then slide for two months and the 50-day average falls to $96. It is now below the 200-day average, so the rule sells at the next opportunity and holds cash until the short average climbs back above.

What it is trying to do

The rule does not predict anything. It reacts. Its aim is to miss the middle of long declines, at the cost of selling late and buying back late. In a long steady rise it tends to trail simply holding, because every false alarm costs a little. In a market that goes sideways it can lose repeatedly, buying after small rises and selling after small falls.

How to test it fairly

What the study on this site does

The Research Lab study tests nineteen pairs of averages, picks one using only the first 70% of the history, and reports that pick on the final 30%. It shows every other pair too, so you can see whether the result depends on one lucky choice. Signals use the closing price and trades are filled at the next day’s open.

Common questions

What is a golden cross?
It is the name for a 50-day moving average rising above a 200-day moving average. The opposite, the 50-day falling below the 200-day, is called a death cross. Both are crossover signals with dramatic names.
Does a moving average crossover work?
It depends on the market and the period. It tends to help in long declines and to cost money in sideways markets. The only honest way to answer for a particular investment is to test it against simply holding, on a period that was not used to choose the settings.
Which moving averages are best?
There is no best pair. A pair that looks best on past data was often just lucky on that data. If many nearby pairs give similar results, the idea is sturdier than if one pair stands alone.

Try it

Reading about a rule is not the same as watching it run. The study is free, needs no account, and starts on practice data.

Open the moving average study →

More guides

Educational explanation with illustrative examples. Not financial advice, and not a recommendation to use any strategy.