Moving averages are the most common way to see the trend through the daily noise, and the two main types are the simple moving average (SMA) and the exponential moving average (EMA). They look alike on a chart but behave differently, and the choice changes how often an alert fires and how late it is. This guide explains the difference and which to use for moving average alerts.
What a moving average does
A moving average takes the closing prices over a set number of days and averages them. Each day the oldest price drops out and the newest is added, so the line moves with the price while smoothing out short-term swings. A price above its moving average is trading above its recent trend, and a price below it is trading under.
Simple moving average (SMA)
The SMA gives every day in the period equal weight. A 50-day SMA is the sum of the last 50 closing prices divided by 50. It is easy to understand and easy to reproduce, which is part of why the 50-day and 200-day SMAs are the standard medium-term and long-term trend lines that so many investors watch.
Exponential moving average (EMA)
The EMA gives more weight to recent prices and less to older ones, using a smoothing factor of 2 ÷ (period + 1). A 20-day EMA therefore reacts faster to a new move than a 20-day SMA. It does not drop old prices abruptly. Their influence fades gradually.
| SMA | EMA | |
|---|---|---|
| Weighting | Equal across the period | More weight on recent prices |
| Reaction to new moves | Slower | Faster |
| Smoothness | Smoother, fewer crosses | Reacts more, more false crosses |
| Common use | Long-term trend (50 and 200 day) | Short and medium-term trend (9, 12, 20, 26 day) |
| Lag | Higher | Lower |
Which should you use for alerts?
There is no universally right answer, but there are good defaults.
- For long-term trend alerts, use the SMA. The 200-day SMA is the line most investors watch, so price crossing it is widely noticed. Its slow pace gives fewer alerts, and each one means more.
- For faster signals, use the EMA. A 20-day EMA catches turns earlier. The cost is more false alarms in choppy markets.
- For crosses between two averages, use the same type for both and the standard lengths. The golden cross and death cross use the 50-day and 200-day SMAs.
The trade-off: a faster average tells you sooner but is wrong more often. A slower average is wrong less often but tells you later. You cannot get both.
Setting the alert
In FearAlert, a moving average alert watches a ticker and fires when the price crosses above or below an SMA or EMA of the period you choose, or when one average crosses another. A few setups:
- Trend change: price crosses below the 200-day SMA. A prompt to review a long-term holding.
- Pullback entry: price crosses back above the 50-day SMA after a dip. A sign that the short-term trend may be recovering.
- Faster exit prompt: price crosses below the 20-day EMA, useful for shorter-term positions.
Add a cooldown of a day or two so a price hovering around the line does not repeat the alert. To cut false crosses, combine the average with a second condition through a compound alert, such as an RSI or Fear & Greed level. MACD is built from EMAs, so it behaves in a similar way. Our guide to RSI and MACD covers it.
Frequently asked questions
What is the difference between SMA and EMA?
The SMA weights every day in the period equally. The EMA gives more weight to recent prices, so it reacts faster to new moves and lags less.
Is EMA better than SMA?
Neither is better. The EMA is faster but produces more false signals, and the SMA is slower and smoother. Longer-term trend lines such as the 200-day are usually SMAs and shorter ones are often EMAs.
Which moving average do most investors watch?
The 50-day and 200-day simple moving averages are the most widely followed. Price crossing the 200-day SMA is a common marker for the long-term trend.
Can I set an alert when price crosses a moving average?
Yes. Create a moving average alert on any stock or ETF, choose SMA or EMA, set the period and the direction, and add a cooldown.
Can I get an alert when one moving average crosses another?
Yes. You can compare two averages, for example the 50-day SMA against the 200-day SMA, to alert on a golden cross or a death cross.
This article is educational and is not financial advice. Moving averages describe past prices and do not predict future ones.