SMA vs EMA
A moving average smooths choppy prices into a single trend line. A simple moving average (SMA) weights every day equally; an exponential moving average (EMA) weights recent days more, so it turns faster.
A moving average is the most basic trend tool in technical analysis. It takes the average closing price over a set number of days and plots it as a line, smoothing out day-to-day noise so the underlying trend stands out. The two most common types are the simple moving average (SMA) and the exponential moving average (EMA).
Simple moving average (SMA)
An SMA adds up the closing prices over a period and divides by the number of days. A 5-day SMA of closes 100, 102, 101, 104, 108 is (100 + 102 + 101 + 104 + 108) ÷ 5 = 103. Every day in the window counts equally, so the SMA is smooth and steady — but slow to react when price changes direction, because old prices keep their full weight until they drop out of the window.
Exponential moving average (EMA)
An EMA gives more weight to the most recent prices and less to older ones. That makes it hug price more closely and turn sooner after a move. The trade-off is that it also reacts to short-lived spikes that an SMA would smooth away — faster, but noisier.
SMA vs EMA at a glance
| SMA | EMA | |
|---|---|---|
| Weighting | All days equal | Recent days heavier |
| Reaction speed | Slower | Faster |
| Noise | Smoother | More responsive, choppier |
| Common use | Long-term trend (50, 200) | Momentum signals (12, 26) |
Common periods
- 20-day — short-term trend, popular for swing trading.
- 50-day — the medium-term trend line many traders watch.
- 200-day — the long-term trend; price above it is broadly bullish, below it broadly bearish.
- 12 and 26-day EMAs — the building blocks of MACD.
When a faster average crosses a slower one, traders read it as a trend change. The most famous example is the golden cross, where the 50-day crosses above the 200-day.
Use moving averages on PSX Algos
The strategy builder offers SMAs (20, 50, 200) and EMAs (12, 26) as drop-in indicators. The Golden cross template uses *SMA(50) crosses above SMA(200)* out of the box — swap in EMAs for faster signals, then backtest the difference across a decade of PSX history.
Build a moving-average strategy →Frequently asked
What is the difference between SMA and EMA?
An SMA weights every day in its window equally, making it smooth but slow. An EMA weights recent days more heavily, so it reacts faster to new price moves but is noisier.
Which is better, SMA or EMA?
Neither is universally better. EMAs are favoured for fast momentum signals where early reaction matters; SMAs are favoured for long-term trend filters where smoothness matters. Many traders use both.
What does the 200-day moving average mean?
It is the average closing price over the last 200 trading days — roughly a year. Price above it is widely seen as a long-term uptrend, and below it a long-term downtrend.
What is a moving average crossover?
It is when a faster moving average crosses a slower one. A famous example is the golden cross, where the 50-day crosses above the 200-day, signalling a possible trend change.