Trading AI

What is a moving average?

Last updated: 27 August 2026

A moving average is the average closing price over a set number of candles, recalculated on every new candle and drawn as a line. That is the whole idea. It is the most common line on any chart, it is the raw material of the MACD and of most trend indicators, and it is misused in the same way almost everywhere: as a signal to act rather than as a description of where price has been.

What the line actually shows

Take the last twenty closing prices, add them up, divide by twenty. Plot the result under the current candle. Do the same on the next candle, dropping the oldest close and adding the newest. Join the dots and you have a twenty period simple moving average.

Two things follow from that, and both matter more than any trading rule built on top:

So a moving average answers one question well: where has price been trading lately, once the noise is removed. It answers no other question at all.

SMA and EMA, and when the difference matters

A simple moving average, the SMA, weights every close in the window equally. A close from twenty candles ago counts exactly as much as the one that just printed.

An exponential moving average, the EMA, weights recent closes more heavily, with the weight decaying as you go back. The effect is that an EMA turns sooner than an SMA of the same period.

That is the entire difference, and it cuts both ways. The EMA reacts sooner to a real move, and it also reacts sooner to a move that turns out to be nothing. Neither one is more accurate: one is faster and noisier, the other is slower and steadier. Choose by how much lag you can tolerate, not by which one backtests better on the chart in front of you.

The periods you will see most often are 20, 50, 100 and 200. They are not magic. They are widely watched, which is a different and more useful reason to know where they sit.

Why a crossover arrives late by construction

A crossover is the moment a faster average crosses a slower one. It is the most published moving average rule in the world, usually as the golden cross, the 50 crossing above the 200, or the death cross going the other way.

Here is the part the headlines skip. Both lines are averages of the past. For a faster average to cross a slower one, the move that caused it has to have already happened, and it has to have been large enough to drag an average of many candles across another average of even more candles. By the time the two lines touch, a good part of the move is behind you.

That does not make crossovers useless. It makes them a confirmation of a change that has already occurred, which is a reasonable thing to want. It just is not an early warning, and anyone selling it as one is selling something the arithmetic cannot deliver.

The moving average as a level

The more useful reading, and the quieter one, is to treat a widely watched average as a moving area of interest rather than as a trigger.

In a trend, price often pulls back toward the 20 or the 50 and resumes. That happens partly because enough traders are watching the same line and acting around it. It is the same mechanism that makes an obvious horizontal level work: not magic, just a crowd looking at the same place. The guide on support and resistance covers why the obvious levels are the ones that matter.

The slope of the line is worth more than the price touching it. A flat average means the market has no direction to describe, and every rule built on it will misfire until the slope returns. A rising average with price above it is a trend you can name in one glance, which is what the line is for.

The mistakes that cost the most

Adding more averages. Three averages do not carry three times the information. They carry the same information at three speeds, and they will disagree exactly when you most want an answer.

Trading the touch in a range. Inside a range, price crosses its own average constantly. Every crossing looks like a signal and none of them are.

Optimising the period. The period that would have worked best on the last hundred candles is the period that fits the noise you already have. It carries no promise about the next hundred.

Reading it without the structure. An average tells you nothing about whether the trend it is describing is still intact. That is what market structure is for, and the two are read together or not at all.

Questions people ask

Which moving average is best?

There is no best one. Shorter periods react sooner and produce more false turns, longer periods react later and produce fewer. The 20, 50 and 200 are the most watched, which makes them more useful than a period nobody else is looking at.

SMA or EMA?

The EMA turns sooner because it weights recent closes more heavily. That is an advantage on real moves and a disadvantage on noise. If you cannot say which of the two problems costs you more, the SMA is the calmer default.

What is the golden cross?

The 50 period average crossing above the 200 period average, usually on a daily chart. It is a confirmation that a large move has already happened, not a prediction that another one is coming.

Do moving averages work on crypto?

The arithmetic is identical anywhere, because it only uses closing prices. What changes is the market. A market that runs 24 hours with thin weekends crosses its own averages more often, so the same rule fires more and means less.

Reading a chart without adding lines

Trading AI reads a photo or a screenshot of any chart and returns what the averages on it are doing, alongside the market structure, the key levels, the momentum reading and a full trade plan with its risk. The analysis works from the image, so an average that is not drawn on the chart cannot be read: what is on screen is what the model has.

The other indicator built entirely out of moving averages, and the one most often misread the same way: What is the MACD?

Momentum measured differently, on a fixed scale rather than as a gap between averages: What is the RSI?

What a single candle records before any average is drawn from it: How to read a candlestick chart

A system that averages the middles of past ranges instead of the closes, and reads nothing like this one: What is the Ichimoku cloud?

This page is educational. It is not financial advice, and nothing here is a recommendation to buy or sell anything.

Read next