Education
11 min read

Moving Averages Explained: SMA vs EMA and How to Use Them in Trading

Moving averages are the backbone of technical analysis. Learn the difference between SMA and EMA, how to combine them for signals, and the pitfalls to avoid.

Gilito Research Team

Technical Analysis & Strategy

Stock chart with moving average lines overlaid showing trend direction

What Is a Moving Average?

A moving average (MA) is a line on a price chart that smooths out price fluctuations by averaging closing prices over a defined period. Instead of staring at jagged daily price bars, a moving average gives you a cleaner picture of whether price is trending up, down, or sideways.

Moving averages are among the oldest and most widely used tools in technical analysis. They appear in virtually every trading platform, and they form the foundation of dozens of more complex indicators — including MACD, Bollinger Bands, and dozens of crossover strategies.


Simple Moving Average (SMA)

The Simple Moving Average adds up the closing prices over N periods and divides by N.

SMA(N) = (P₁ + P₂ + ... + Pₙ) / N

Example: A 20-day SMA on March 12, 2026 averages the closing prices from February 12 to March 12.

Each day, the oldest price drops off and the newest price is added. The line moves forward in time — hence "moving."

Key properties of SMA

Property Value
Lag High — all periods weighted equally
Smoothness Very smooth
Sensitivity Slow to react to recent price changes
Best for Identifying long-term trends, support/resistance levels

Common SMA periods: 20, 50, 100, 200 days.


Exponential Moving Average (EMA)

The Exponential Moving Average applies a multiplier that gives more weight to recent prices, making it faster to react to new market information.

EMA = Price(t) × k + EMA(t-1) × (1 - k)
k = 2 / (N + 1)

For a 20-period EMA: k = 2 / (20 + 1) = 0.095

So today's price gets ~9.5% weight. Yesterday's EMA carries the remaining 90.5%.

Key properties of EMA

Property Value
Lag Lower — recent prices weighted more
Smoothness Less smooth than SMA
Sensitivity Faster to react to price moves
Best for Short-term momentum, active trading signals

Common EMA periods: 9, 12, 20, 26, 50 days.


SMA vs EMA: Which Is Better?

Neither is objectively better. The right choice depends on your strategy.

Scenario Preferred MA
You want to reduce false signals in choppy markets SMA
You want to catch trend changes early EMA
You're measuring long-term trend direction SMA (200-day)
You're trading breakouts or momentum EMA (9 or 20-day)
You're building a crossover system Both (EMA for fast, SMA for slow)

In backtesting, EMAs tend to outperform SMAs in trending markets and underperform in sideways markets because their speed cuts both ways — they catch trends earlier but also generate more false signals during consolidation.


Moving Average Crossover Strategies

Crossover strategies are the most common way traders use moving averages to generate buy and sell signals.

The Dual Moving Average Crossover

Signal logic:

  • Buy: Fast MA crosses above Slow MA
  • Sell: Fast MA crosses below Slow MA
Buy  when EMA(9)  crosses above EMA(21)
Sell when EMA(9)  crosses below EMA(21)

Golden Cross and Death Cross

The most widely watched crossover signals in markets:

Signal Definition Interpretation
Golden Cross 50-day MA crosses above 200-day MA Long-term bullish signal
Death Cross 50-day MA crosses below 200-day MA Long-term bearish signal

These signals make headlines on financial news because they're visible to millions of market participants — creating self-fulfilling momentum.

Statistical reality: Golden/Death Cross signals work better as regime filters than direct trade signals. They identify whether the broad market environment is favorable for long positions, not when to enter specific stocks.

Triple Moving Average Crossover

Three MAs reduce false signals by requiring two conditions:

Fast MA:   9-day EMA
Medium MA: 21-day EMA
Slow MA:   50-day EMA

Buy  when Fast > Medium > Slow (all aligned up)
Sell when Fast < Medium < Slow (all aligned down)

When all three MAs are stacked in the same direction, the trend is more likely to be genuine.


Moving Average as Support and Resistance

Beyond crossover signals, moving averages serve as dynamic support and resistance levels.

  • In uptrends, price often bounces off the 20-day or 50-day EMA
  • In downtrends, price often rallies to the 50-day SMA before resuming lower
  • The 200-day SMA is a major institutional reference for long-term trend direction

Why this works: Large institutions (mutual funds, pension funds, hedge funds) use these same MAs to size positions and manage risk. Their buying at MA support becomes self-reinforcing.


Moving Average Envelopes

MA envelopes add percentage bands above and below a moving average to measure whether price is extended.

Upper band = MA × (1 + Band%)
Lower band = MA × (1 - Band%)

Example with 20-day SMA and 2.5% bands:

  • Upper band = SMA(20) × 1.025
  • Lower band = SMA(20) × 0.975

When price touches the upper envelope, it may be overbought. When it touches the lower envelope, it may be oversold. These are mean reversion entry signals.


MACD: Two EMAs in One Indicator

The MACD (Moving Average Convergence Divergence) is built from two EMAs:

MACD Line   = EMA(12) - EMA(26)
Signal Line = EMA(9) of MACD Line
Histogram   = MACD Line - Signal Line

When the MACD Line crosses above the Signal Line: bullish momentum. When the MACD Line crosses below the Signal Line: bearish momentum.

MACD is essentially a crossover strategy with a built-in trend filter — one of the most durable patterns in quantitative research.


Common Mistakes When Using Moving Averages

1. Using Moving Averages in Sideways Markets

MAs are trend-following tools. In choppy, range-bound conditions, crossover signals whipsaw constantly. Always check whether the market is trending before applying MA strategies.

2. Curve-Fitting the Period

Testing every period from 5 to 200 to find the one that worked best historically is a form of overfitting. The "best" period in backtest will rarely be the best in the future.

3. Ignoring Lag

Every MA lags price by definition. A buy signal after a 50-day MA cross may come 10–15 days after the actual low. Plan entry accordingly.

4. Treating MAs as Predictive

Moving averages describe what has happened, not what will happen. They're useful for staying on the right side of a trend, not predicting reversals.


How Gilito Uses Moving Averages Systematically

Rather than hand-picking one MA period and hoping it works, Gilito's engine tests thousands of combinations across every period, every asset, and every market regime — including:

  • Single MA trend filters (is price above/below MA?)
  • Dual MA crossovers (all permutations of fast/slow periods)
  • Triple MA alignment signals
  • MA slope and momentum conditions
  • MA combinations with RSI, Bollinger Bands, volume indicators

This approach finds which specific MA configurations are statistically robust on each asset right now — not what worked on average across all assets five years ago.


Frequently Asked Questions

Which moving average period should I use? Start with 20 and 50 for medium-term trend analysis, and 200 for the long-term trend. Add 9 or 12 EMA for faster entry timing. Test combinations on your specific asset before committing.

Do moving averages work on all timeframes? Yes — the logic is the same whether you're on daily, weekly, or hourly charts. Shorter timeframes produce more signals and more noise. Longer timeframes produce fewer, more reliable signals.

Why does the 200-day moving average matter so much? Institutional investors widely use the 200-day SMA as a benchmark for long-term positioning. This collective attention creates a self-reinforcing support/resistance level.

What's the difference between a moving average and a moving average ribbon? A ribbon plots multiple MAs simultaneously (e.g., 10, 20, 30, 40, 50-day). When they fan out, the trend is strong. When they converge, the trend may be weakening or reversing.

How do I avoid moving average whipsaws? Combine your MA signal with a volatility or volume filter. Require that the ADX (Average Directional Index) be above 25 before entering a crossover trade — this filters out low-trend environments where whipsaws are most frequent.


The Bottom Line

Moving averages are not a magic formula. They are a tool for context — helping you know whether to trade with or against the prevailing trend, and where price tends to find support or resistance.

Used systematically — with consistent parameters, proper backtesting, and an honest look at costs — moving averages form the backbone of many durable trading strategies. The key is to treat them as one input in a larger framework, not the sole decision rule.

Platforms like Gilito evaluate moving average configurations across millions of combinations per asset daily, surfacing the specific settings that are working in the current market regime — so you're not guessing which period to use.

Tags:moving averagesSMAEMAtechnical analysistrading signals

Found this useful?

Gilito backtests 100,000,000+ strategies daily so you get actionable signals — not guesswork. Try it free.

Get in touch

Related Articles