Open almost any stock chart and you will see one or more smooth lines running through the price. These are moving averages, among the oldest and most widely used tools in technical analysis.
This article explains how they are calculated, the difference between simple and exponential versions, which periods are popular and why, what crossovers are supposed to signal, and the limits every user should understand before relying on them.
What a moving average is
A moving average is the average closing price over a fixed number of recent periods, recalculated each period as a new price arrives and the oldest one drops out. Plotted on a chart, it produces a line that smooths out day-to-day noise and shows the general direction of price.
A 20-day average uses the last 20 closing prices; a 200-day average uses the last 200. The longer the period, the smoother the line and the more slowly it reacts to new prices.
The idea is simple: individual days are noisy, but the average of many days reveals the underlying trend. If the line is rising, prices have on average been rising; if it is falling, they have on average been falling.
Simple versus exponential
A simple moving average (SMA) gives equal weight to every price in the window.
Worked example with a 5-day SMA. Closing prices: 100, 102, 101, 105, 107. Their sum is 515, so the average is 103. The next day closes at 110. The oldest price (100) drops out and 110 comes in: 102, 101, 105, 107, 110, sum 525, average 105.
An exponential moving average (EMA) gives more weight to recent prices, so it reacts faster. Each day it moves a fraction of the way towards the latest price. For a 5-day EMA, that fraction is 2 divided by (5 + 1), or one third.
Continuing the example, starting the EMA at the SMA of 103: the next close is 110, which is 7 above the current value. The EMA moves one third of that distance, to about 105.3, slightly above the SMA's 105. When prices change direction, the EMA turns sooner.
Neither is better. The EMA reacts faster but gives more false signals; the SMA is steadier but slower. Many traders simply pick one and use it consistently.
Popular periods and why they matter
Short averages (around 10 to 20 days) track recent swings and are used by short-term traders.
Medium averages (around 50 days) reflect the intermediate trend, roughly a quarter of trading.
Long averages (around 200 days) reflect the long-term trend, roughly a year of trading. Whether a stock or index is above or below its 200-day line is one of the most widely quoted observations in markets.
There is nothing magical about these numbers. They matter mainly because so many people watch them. When a widely followed line is approached, enough traders may act around it to make it temporarily relevant, in the same way that price zones on a chart attract attention.
Intraday traders apply the same idea to shorter bars, such as a 20-period average on a five-minute chart.
How traders use them
Trend direction. Price above a rising long average suggests an uptrend; price below a falling one suggests a downtrend. Many traders only take trades in the direction of that trend.
Crossovers. When a shorter average crosses above a longer one, some treat it as a sign of strengthening momentum; a cross below as weakening. The cross of the 50-day above the 200-day is popularly called a golden cross, and the opposite a death cross.
Dynamic levels. In trending markets, price often pulls back towards a short or medium average before resuming. Some traders treat the line as a moving zone where buying or selling interest may appear.
Distance from the average. When price has moved unusually far from its average, some traders consider the move stretched and less attractive to chase.
As a filter, not a trigger. Many experienced traders use averages to decide which direction to favour, then use other information to decide when to act.
The limits: lag and whipsaws
They lag by design. An average is built from past prices, so it always confirms a move after it has started. A crossover often arrives after a meaningful part of the move has already happened.
Whipsaws in sideways markets. When prices move in a range, the shorter line repeatedly crosses the longer one, producing a series of small losing signals. Crossover systems tend to do well in strong trends and poorly in ranges, and nobody knows in advance which kind of market is coming.
Results depend heavily on the period chosen. A period that looks excellent on past data may simply have been fitted to that data. Testing many periods and picking the best one is a common way to fool yourself.
Gaps and news override them. A result or policy announcement can move price far beyond any average overnight.
Costs matter. Frequent signals mean frequent trades, and charges and slippage can turn a system that looks profitable on a chart into a losing one.
Using them sensibly
Pick a small set and stick with it. Two or three periods applied consistently are more useful than constantly switching.
Match the period to your holding time. A 200-day line says little to an intraday trade; a 10-day line says little to an investment held for years.
Test before trusting. Write down your rules, apply them to past data with realistic costs, then paper trade before risking money. Keep a journal of how signals actually behaved.
Combine with risk control. No line removes the need for position sizing and a defined exit.
For long-term investors, these lines are mainly context. A diversified investor buying index funds through regular instalments does not need to time entries around crossovers.
An account with full charting tools
Add averages and other indicators to any chart, and test ideas before committing money. Free to open
This is educational material, not advice, and no stock, index or system is recommended. We run no tips group and no signal service, we manage nobody's money, and no return is promised.
Disclosure: the account-opening link on this page is under Atul Shrivastava's Zerodha Authorised Person registration (NSE AP Reg: AP2516003481; Zerodha Broking Ltd. SEBI Reg: INZ000031633) and earns a revenue share. TheFinBaba is not a SEBI-registered Investment Adviser — this content is educational, not investment advice.
Frequently Asked Questions
What are moving averages in stock trading?
Lines showing the average closing price over a fixed number of recent periods, recalculated each period, used to smooth noise and show the direction of the trend.
What is the difference between SMA and EMA?
A simple average weights every price in the window equally. An exponential average gives more weight to recent prices, so it reacts faster but produces more false signals.
Why is the 200-day moving average important?
It reflects roughly a year of trading and is very widely watched, so price above or below it is a common shorthand for the long-term trend.
What is a golden cross?
When the 50-day average crosses above the 200-day average, popularly read as strengthening momentum. The opposite is called a death cross. Both lag the move.
Do moving average crossovers work?
They tend to do well in strong trends and poorly in sideways markets, where repeated crossings cause small losses. Results depend on the period and on costs, so test before relying on them.
Related Reading
- A sentiment gauge from options data
- Price zones that attract attention
- The candles underneath the line
- Trend-following swing setups
- Testing a crossover rule on past data
- Trying signals without real money
Disclaimer: TheFinBaba provides educational content only - this is not investment advice. Trading involves risk of loss.