Moving averages — the trader's first tool

Reading for India · about 12 min

The answer

A moving average is the average closing price of the last N days, recalculated every day. It measures 1 thing only: the direction and the level of recent price, with the day-to-day noise removed. It works well when there is a trend to reveal, and it produces a stream of losing signals when there is not.

Why this costs you money

A stock has been moving sideways between 200 and 230 for 4 months. You put a 50-day and a 200-day moving average on the chart, because that is what everybody does.

The 2 lines sit on top of each other in the middle of the range, and they cross. You buy. Price drifts to 210 and they cross back. You sell at a loss. Three weeks later they cross again. You buy again, slightly higher than last time.

In a 4-month range, that pattern can repeat 5 or 6 times. Each loss is small. Together they are not small, and the brokerage and taxes on 12 trades in a sideways stock are a real number. You have not been unlucky. You used a tool that is designed to detect trends, on a chart with no trend, and it did exactly what its arithmetic requires it to do.

The second version costs more and takes longer to notice. A trader waits for the "golden cross", where the 50-day average crosses above the 200-day. It is the most famous signal in retail trading. By the time it appears, price has usually risen a long way from the low, because a 200-day average of 200 rising days cannot turn up early. The signal is real. It is also late by construction, and a trader who does not understand that treats the lateness as bad luck rather than as the price of the tool.

A moving average is a filter, not a forecast. Used as a forecast in a range, it is a machine for small repeated losses.

How it works

Take the closing prices of the last 20 days. Add them. Divide by 20. That is the 20-day simple moving average, or SMA. Tomorrow, drop the oldest close, add the newest, and divide again. The line moves.

The exponential moving average, or EMA, does the same job but gives more weight to recent days and less to older ones. An EMA turns sooner than an SMA of the same length. It also reacts more to a single unusual day.

That is the entire difference. An EMA is faster and noisier. An SMA is slower and steadier. Neither is better. They are 2 points on the same trade-off you met in the previous article.

What the period actually means

The number of days is a statement about which timeframe you are trading.

PeriodWhat it is usually used forWhat it ignores
20 daysShort-term direction, about 1 monthAnything older than a month
50 daysIntermediate trend, about a quarterShort pullbacks inside the trend
200 daysLong-term trend, about 1 trading yearEverything except the big picture

There is nothing special about 20, 50 or 200. They are round numbers that correspond roughly to a month, a quarter and a year of trading days. They became standards because enough people used them, and there is a weak self-fulfilling element: when many traders watch the same line, orders cluster near it.

The three classic uses

1. Direction. Price above a rising average is an uptrend by this definition. Price below a falling average is a downtrend. The word "definition" matters. This is not a prediction. It is a way of labelling what already happened, so that you stop arguing with yourself about whether a stock is going up.

2. Crossovers. When a shorter average crosses above a longer one, recent prices have moved above older prices. The 50 crossing above the 200 is called a golden cross. The reverse is called a death cross. Both names are far more dramatic than the events.

3. Dynamic support and resistance. In a strong trend, price often pulls back to an average and resumes. This is the most useful of the 3 and the hardest to state as a rule, because "often" is doing a lot of work in that sentence.

What it tells you, and what it does not

A moving average tells you where price has been, smoothed. Everything else is inference.

It does not lead. It cannot. Every value in a 200-day average is a price that already happened. If you find a moving average system that appears to anticipate turns, you have found a coincidence in a sample.

It does not know the market condition. This is where it breaks, and the break is total. In a range, a moving average sits in the middle of the range and price crosses it repeatedly. Every crossing is a signal. Almost every signal is wrong, because in a range the correct action after a move up is to expect a move down, which is the opposite of what the crossover says.

Put precisely: a moving average has positive expectancy only when the size of the trends it catches exceeds the total cost of the false signals it generates while waiting. In a trending market that holds. In a range it does not, and no adjustment to the period fixes it — a shorter period gives more false signals, a longer period gives fewer but larger ones.

The lag is measurable, not vague. A simple moving average of N days lags the price by roughly N divided by 2 days in a steady trend. A 200-day average is therefore about 100 days behind. That is not a criticism. It is the specification.

The decision rule

Use a moving average to decide whether you are allowed to take a trade, not to decide when to take it.

If price is above a rising longer average, take long setups from your other tools and skip the short ones. If price is below a falling longer average, reverse it.

Unless the average is flat and price has crossed it more than twice in the last 2 months. That is a range. In a range the moving average is not a filter and not a signal — it is the middle of the range, and it should be ignored entirely until it starts to slope.

The test for "flat" is simple enough to do by eye. Look at the average over the last 3 months. If you cannot tell which way it is sloping without measuring, it is flat.

Try this now

This takes 5 minutes and it is the single most useful exercise in this cluster. You will do a version of it for several indicators.

  1. Open 2 daily charts, each set to 1 year. Pick 1 stock from your own watchlist that has clearly trended in one direction, and 1 that has moved sideways. You can tell which is which by eye in 2 seconds, and that is the point.
  2. On both, add a 50-day simple moving average and a 200-day simple moving average.
  3. On the trending chart, count every crossover of the 2 lines in the last year. Write the number down.
  4. On the ranging chart, count the same thing. Write the number down.
  5. Now go back to the ranging chart. For each crossover, look at what price did over the following 20 trading days. Mark each one followed or not followed.

What you should see. The trending chart will usually have 0, 1 or 2 crossovers in a year. The ranging chart will often have 4 or more. The tool produces the most signals exactly where it works least, which is the opposite of what a useful tool should do.

In step 5, on a genuine range, you will typically find that fewer than half the crossovers were followed by a move in the signalled direction over the next 20 days. If you get 3 out of 8, you now know something about this indicator that no article can tell you as convincingly as your own count.

Keep the 2 numbers. Write them in a note. You will compare them with the equivalent counts for RSI, MACD and Bollinger Bands later in this cluster.

Three real cases

1. The S&P 500 death cross, March 2020 (United States)the lagging signal that fired at the low The COVID crash took the S&P 500 down roughly a third in about a month. The 50-day average crossed below the 200-day in the second half of March 2020, within days of the market bottom on 23 March 2020. A trader who sold on the death cross sold near the low of the whole event, and the index recovered its previous high before the end of the year. This is not evidence that the signal is useless. It is evidence of exactly what lag means: a fast crash is the worst possible input for a slow filter, because the entire move completes inside the averaging window.

2. The NIFTY 50 through 2022 (India)a year of crossings with no trend The NIFTY 50 spent 2022 in a wide, choppy range, falling in the first half and recovering in the second, and finished the year close to where it began . Across such a year the 50-day and 200-day averages converge and cross more than once, and price crosses the 50-day average many times. Every crossing was a signal. The index went nowhere. There was no trend to catch, so a trend tool had nothing to give.

3. Brock, Lakonishok and LeBaron, 1992, and its sequel (United States)the study everybody quotes and the one they do not The 1992 paper tested moving average rules on the Dow Jones Industrial Average over roughly 90 years to 1986, and reported predictive power. It is still the citation used to sell moving average systems. Sullivan, Timmermann and White re-tested the same family of rules in 1999, adjusting for the number of rules searched before the best was reported, and found the apparent edge much smaller — and notably weaker in the data after 1986, which the original authors had not seen. The honest summary is that moving average rules on a broad index looked profitable in the sample where they were discovered and much less so afterwards.

The question that resolves it

A novice looks at a moving average crossover and asks: is this a buy signal?

An expert asks: is this average sloping, or is it flat?

The same crossover means 2 completely different things depending on the answer. A crossover on a sloping average is a trend continuing or beginning. A crossover on a flat average is price wandering across the middle of a range, and it carries no information at all.

What would make this wrong

The claim is that moving averages work in trends, fail in ranges, and lag by an amount you can calculate.

You would falsify it by finding a market where moving average crossovers were followed by the expected move at a rate well above chance, during a period when the averages were flat. Run the counting exercise above on 10 ranging charts. If the crossovers were followed more than 6 times out of 10, this article is wrong.

You would falsify the lag claim by finding a moving average that turned before price did. It cannot happen, because the calculation only uses past prices, but the fact that it cannot happen is worth seeing on a chart rather than accepting on authority.

The honest limits are 3.

First, "range" and "trend" are labels applied after the fact. In real time you often cannot tell which one you are in, and the moving average will not tell you — that is what a separate trend-strength measure such as ADX is for.

Second, a low win rate does not automatically mean a losing system. A moving average approach can be right 35% of the time and still make money if the winning trades are much larger than the losing ones. The counting exercise measures how often, not how much. Both matter, and this article only teaches you to measure the first.

Third, everything here is about liquid instruments. On a thinly traded share, a moving average is being calculated from prices that a single order set, and the line means very little.

In India

Indian traders and Indian financial media use the same 50-day and 200-day averages, usually written as 50 DMA and 200 DMA, where DMA means daily moving average. The NIFTY 50's position relative to its 200 DMA is quoted in market reports almost every day.

Three Indian details change the calculation itself.

The trading calendar is different. Indian markets close for many festival holidays, and the dates move each year. A "200-day moving average" is 200 trading days, not 200 calendar days, so the Indian 200 DMA covers a slightly longer stretch of calendar time than the American one in a year with more market holidays. The effect is small but it is real, and it means the Indian and US 200-day averages are not measuring the same window.

Price bands compress the input. Shares outside the derivatives segment carry daily bands of 2%, 5%, 10% or 20%. A stock that would have gapped 25% instead moves 20%, closes at the band, and continues the next day. The moving average sees a smooth staircase rather than a single jump. This makes Indian moving averages look better behaved than the underlying demand actually was.

Corporate actions must be adjusted. A bonus issue or a stock split changes the price without changing the company. If your charting platform does not adjust history for the action, a 200-day average will be badly wrong for months afterwards. Most major platforms adjust automatically, but it is worth checking on any stock that has had a split, because an unadjusted 200 DMA sitting far above price will make a healthy stock look broken.

There is 1 more Indian-specific use worth knowing. Under SEBI's rules for preferential allotments, the issue price is set from a volume-weighted average of past prices over defined windows, so an averaged price has a legal role in India that it does not have in charting. That is a different average, but it is a reminder that averaging price over a window is a standard way of removing manipulation from a single day, which is also why it works on a chart.

In the United States

The 50-day and 200-day averages on the S&P 500 are quoted constantly in American financial media, and the golden cross and death cross generate headlines. That attention has a measurable effect: option and futures activity clusters around these levels, and index funds do not care about them at all.

Three US-specific details.

Extended-hours trading breaks the close. US shares trade before 9:30 and after 16:00 Eastern time. The official closing price used in a moving average is the 16:00 price. On a results day, a stock can move 10% after that print. The moving average records the pre-announcement close and picks up the move the next day. For a fast-moving stock, the daily average is always working from a number the market had already abandoned.

There are no daily price bands. A US stock can fall 40% in a session. When that happens, the whole move enters the average at once, and a 20-day average can be dragged well away from anything meaningful by a single day. Indian averages are protected from this by the bands. American ones are not.

Data history is long and clean. The Dow has usable daily data going back to the 1890s, which is why every academic test of moving average rules used American indices. When you read that a moving average rule "has worked for a century", the century is American.

Where they differ, and what that tells you

The difference is what happens on the worst days.

An Indian moving average has its extreme inputs cut off by price bands. An American moving average absorbs the full extreme, and it also misses part of the move because it happened outside market hours.

What that tells you is about your stops. If you set a stop below a moving average, you are assuming the average is a fair summary of recent price. On an Indian stock that has been locked at circuit limits, the average is too high, because the days that would have pulled it down were truncated. On a US stock that just reported results, the average is stale, because the real move happened after the close.

It also tells you why a moving average system tested on US data can behave differently in India. In the US, a large part of a system's losses come from single violent days. In India those days are spread across several sessions by the bands, which makes the equity curve look smoother and gives a false impression of safety — the loss is the same size, it just arrives more slowly, and a trader who cannot exit a circuit-locked stock takes all of it.

Carry this

  • A moving average is the average of the last N closes. It measures direction with noise removed, and nothing else.
  • It works in trends and it manufactures losses in ranges. The slope of the line tells you which one you are in.
  • The lag is roughly half the period. A 200-day average is about 100 days behind, by design, and no setting removes that.

Knowledge check

Q. Two stocks each produce a 50-day above 200-day crossover on the same Monday.

On stock A, the 200-day average has been rising steadily for 7 months and price has been above it for most of that time.

On stock B, the 200-day average has been almost flat for 7 months, and this is the third crossover in that period.

The 2 charts show the same signal. What is the most important difference?

Explanation. A crossover is 2 lines meeting. What makes it meaningful is the slope of the longer line underneath it, because the slope is what says a trend exists at all. On stock A the 200-day average has been rising for 7 months, so recent prices have been consistently above older ones, and the crossover is the shorter average confirming a condition that is already established. On stock B a flat 200-day average means older and newer prices are roughly the same. The 2 lines are both sitting in the middle of a range, and they will cross whenever price passes through the middle, which it will do repeatedly.

The third option is the tempting one, and it is tempting because repetition usually looks like reliability. It is exactly backwards here. Three crossovers in 7 months is the signature of a flat average, and each one of those previous crossovers was a signal that failed. A pattern that keeps repeating on the same chart is not an established pattern. It is a tool producing noise.

The last option contains a true statement — stock A's signal is late — and draws the wrong conclusion from it. Lateness is the fixed cost of a moving average. Paying it on a real trend is the trade. Paying it on a range is the mistake.