Technical Analysis

What is Moving Average?

Reviewed by Karthikeyan Anbarasan (Founder, TradeLyser) · Updated 19 Oct 2026 · Editorial policy

DefinitionA moving average is the average closing price over the last N bars, recalculated as each new bar closes, which smooths out day-to-day noise so the direction of the trend is easier to see. A 5-day simple moving average of illustrative Nifty closes of 24,800, 24,900, 25,000, 24,950 and 25,100 is 1,24,750 ÷ 5 = 24,950.
Formula
SMA = Sum of the last N closes ÷ N; EMA today = Close × k + EMA yesterday × (1 − k), where k = 2 ÷ (N + 1)
Example
20-day EMA: k = 2 ÷ 21 = 0.0952. Close 25,100, previous EMA 24,900: 24,900 + 0.0952 × 200 = 24,919 (illustrative)

How it is calculated

A simple moving average (SMA) adds the last N closes and divides by N. When a new bar closes, the oldest one drops out and the new one comes in, which is why the line “moves”. Most platforms use the closing price by default, though the input can be changed.

DayClose5-day sum5-day SMA
124,800
224,900
325,000
424,950
525,1001,24,75024,950
625,0501,25,000 (24,800 out, 25,050 in)25,000
Formula
EMA today = Close × k + EMA yesterday × (1 − k), where k = 2 ÷ (N + 1)
Example
Illustrative 20-day EMA: k = 0.0952. Previous EMA 24,900, close 25,100: 25,100 × 0.0952 + 24,900 × 0.9048 = 24,919

SMA vs EMA

Simple (SMA)

Every close in the window counts equally. Smoother, slower to turn, and it jumps when a large old bar drops out of the window.
Often used for: 50- and 200-day trend filters

Exponential (EMA)

Recent closes count more, and older ones fade gradually instead of dropping out. Turns sooner, but also reacts more to noise.
Often used for: 9, 20 and 21-period entries and exits

Every moving average lags price, because it is built from past closes. An SMA’s centre sits (N − 1) ÷ 2 bars back, so a 20-day SMA reflects price from about 9.5 sessions ago and a 200-day SMA from about 100 sessions ago. An EMA of the same period lags less, which is the whole trade-off: less lag means more false turns.

Common periods and what they are used for

AverageChartTypical use
9 and 21 EMA5- or 15-minuteIntraday trend direction and pullback entries
20 EMA or SMADailyShort swing trend; trailing exits
50 SMADailyMedium-term trend filter
200 SMADailyLong-term trend; the most widely watched line on Nifty and large caps
50 / 200 crossoverDailyGolden cross (50 above 200) and death cross (50 below 200)

How traders use it, with a worked trade

Moving averages are used four ways: as a filter (trade only in the direction of the slope), as dynamic support or resistance for pullback entries, as crossover signals, and as a trailing exit. Illustrative swing trade in a large-cap NSE stock trading above a rising 50-day SMA: price pulls back to ₹1,480 while the average is at ₹1,476. A buy at ₹1,488 with a stop at ₹1,458, below the average with a buffer, risks ₹30 a share. With ₹9,000 of risk that is 300 shares.

Risk at entry, 300 shares
₹9,000
Exit: first daily close below 20 EMA
₹1,566
Profit before charges
₹23,400
Result in R
2.6R

The exit at ₹1,566 is ₹78 a share above entry, ₹23,400 on 300 shares. In your journal, tag such trades “with MA trend” or “counter-trend” and record which average the entry and exit were based on, so the review can compare expectancy for each bucket after 30 or more trades.

For traders in India
Build daily averages on cash market closes at 15:30. On futures, continuous charts join one monthly contract to the next, and the price difference at rollover can shift a long average such as the 200-day. Use the spot index or a back-adjusted continuous chart for long averages, and note which one in the trading plan.

Reference guide

ContextValueReading
Price above a rising 50-day average, trades taken only longClear trend filterWorks while the trend lasts; in a sideways market price crosses the line back and forth
Crossover signals used in a range-bound monthWhipsawsEach cross reverses within days and each one costs a small loss plus charges
Period changed after every losing streakCurve fittingThe settings end up describing the past few weeks, not the setup; fix the period in the plan

Questions

What is the best moving average for intraday trading?

There is no single best one. 9 and 21-period EMAs on 5- or 15-minute charts are common, often alongside session VWAP. Pick one set, write it in the plan, and judge it on your own logged trades.

What is the difference between SMA and EMA?

An SMA weights every close in the window equally. An EMA gives more weight to recent closes, so it turns sooner but also produces more false signals.

What is the 200-day moving average?

The average of the last 200 daily closes. It is widely used as a long-term trend line: price above a rising 200-day average is read as a long-term uptrend.

How do you calculate a moving average?

For an SMA, add the last N closes and divide by N. For an EMA, use EMA = Close × k + previous EMA × (1 − k), with k = 2 ÷ (N + 1).

What is a golden cross?

When the 50-day moving average crosses above the 200-day. The opposite, the 50 crossing below the 200, is called a death cross. Both lag price by weeks.

Related terms