Back to Learn

What Is a Moving Average? SMA and EMA Explained for Stock Screeners

Technical Analysis
9 min read
By ScreenerHub Team

What Is a Moving Average (SMA / EMA)?

A moving average smooths out day-to-day price fluctuations by averaging a stock's closing prices over a set number of periods. The two main types — the Simple Moving Average (SMA) and the Exponential Moving Average (EMA) — are the foundation of technical trend analysis and among the most widely used filters in stock screeners worldwide.

SMA(N)=1Ni=1NPi\text{SMA}(N) = \frac{1}{N} \sum_{i=1}^{N} P_i

The most commonly tracked periods are 20, 50, and 200 days. When a stock's price crosses above or below a key moving average — especially the 200-day SMA — it is one of the most widely watched signals in equity markets.

TL;DR: A moving average reveals the direction of a stock's price trend by filtering out daily noise. Price above the 200-day SMA = long-term uptrend. Price below it = long-term downtrend. The Golden Cross (50-day SMA crossing above 200-day SMA) is a classic bullish signal. You can filter for stocks above their 50-day or 200-day moving average directly in ScreenerHub.


Why Moving Averages Matter for Stock Screening

Raw price data is noisy. A stock can close down 3% one day and up 2% the next with no change in the underlying business at all. Moving averages cut through that noise to reveal whether the price trend is actually pointing up, down, or sideways.

Think of moving averages as the "tide" beneath the daily "waves" of price movement. If a stock is trading above its 200-day SMA, the long-term tide is in — regardless of short-term dips. If it has crossed below that average, the tide has turned and the long-term trend has deteriorated.

For stock screeners, moving averages serve two distinct purposes: trend confirmation (is this stock in an uptrend at all?) and entry timing (has price pulled back to a known support level?). Unlike purely fundamental metrics such as the P/E ratio or earnings per share, moving averages capture what the market is doing with a stock's price right now.

What moving averages add to a fundamental screen

Without moving averagesWith moving averages
Finds quality stocks, but no trend filterNarrows to stocks also in confirmed uptrends
May surface stocks in long-term downtrendsFilters out downtrending stocks automatically
No context on price directionImmediately flags medium- and long-term momentum
No dynamic support or resistance reference pointMA levels act as objective entry and exit guides

How Moving Averages Are Calculated

Simple Moving Average (SMA)

The SMA adds up the closing prices over N days and divides by N. Each new day, the oldest closing price drops out of the window and the newest one enters.

SMA(N)=P1+P2++PNN\text{SMA}(N) = \frac{P_1 + P_2 + \cdots + P_N}{N}

Where PiP_i is the closing price on day $i$ and $N$ is the period length. Every day in the window is weighted equally — day 1 counts the same as day 50.

Exponential Moving Average (EMA)

The EMA also averages closing prices over N days, but gives more weight to recent prices via a smoothing multiplier $k$.

EMAtoday=Ptoday×k;+;EMAyesterday×(1k)\text{EMA}{\text{today}} = P{\text{today}} \times k ; + ; \text{EMA}_{\text{yesterday}} \times (1 - k)

Where the multiplier $k$ is:

k=2N+1k = \frac{2}{N + 1}

For a 20-day EMA, k=2/210.095k = 2 / 21 \approx 0.095. Each new closing price contributes about 9.5% to the EMA value; the prior EMA carries the remaining 90.5%. Because recent prices have higher influence, the EMA hugs the current price more closely than an SMA of the same period.

SMA vs EMA — key differences

SMAEMA
Price weightingEqual weight to all N periodsMore weight to recent prices
ResponsivenessSlower to react to price changesFaster to react to price changes
Line qualitySmoother, less noiseMore dynamic, tighter to price
Best forLong-term trend identificationShort-term momentum and entry timing
Common periods50-day, 100-day, 200-day12-day, 26-day, 50-day

Concrete example (10-day SMA vs EMA)

Suppose a stock closes at 100, 102, 101, 104, 107, 106, 109, 110, 108, 112 over 10 consecutive days.

SMA(10)=100+102+101+104+107+106+109+110+108+11210=1,05910=105.9\text{SMA}(10) = \frac{100 + 102 + 101 + 104 + 107 + 106 + 109 + 110 + 108 + 112}{10} = \frac{1{,}059}{10} = 105.9

For the EMA with k=2/(10+1)0.182k = 2 / (10 + 1) \approx 0.182, each new day's price carries roughly 18% weight. Because the last few closes (108, 110, 112) are higher, the EMA lands above the SMA — approximately 108.4.

Day 10 close10-Day SMA10-Day EMA (approx.)
$112$105.9~$108.4

The EMA is about 2.5 points higher than the SMA because it reacts faster to the recent upward move.


How to Interpret Moving Averages

The most practical question is simple: is the stock trading above or below its key moving averages?

Price position relative to moving averages

ConditionWhat It Typically Signals
Price > 200-day SMALong-term uptrend; stock above major institutional support
Price < 200-day SMALong-term downtrend; trend is deteriorating or broken
Price > 50-day SMAMedium-term bullish momentum
Price < 50-day SMAMedium-term bearish pressure
Price crossed above MA from belowPotential trend reversal upward — watch for follow-through
Price crossed below MA from abovePotential trend reversal downward — caution warranted

⚠️ Context matters: Moving averages are lagging indicators. They confirm trends after they have started, not before. In choppy, sideways markets, MA crossovers can produce many false signals. Always combine moving average filters with volume and at least one fundamental metric before drawing conclusions.

Golden Cross and Death Cross

Two of the most closely watched signals in technical analysis involve the relationship between the 50-day SMA and the 200-day SMA:

  • Golden Cross: The 50-day SMA crosses above the 200-day SMA. Interpreted as a long-term bullish signal — short-term momentum is strengthening relative to the long-term baseline.
  • Death Cross: The 50-day SMA crosses below the 200-day SMA. Interpreted as a long-term bearish signal — short-term momentum has turned negative relative to the long-term trend.

These signals attract significant institutional attention when they form on major indices like the S&P 500. On individual stocks, they mark inflection points worth investigating in combination with RSI and fundamental quality filters.


Moving Averages in a Stock Screener

Moving average filters act as trend gatekeepers — they automatically keep stocks in confirmed uptrends and filter out those in downtrends. This is especially useful when you want to add price-level discipline to a fundamentals-based screen.

Screener 1: Price above 50-day and 200-day SMA (confirmed uptrend)

Find stocks in established long-term uptrends that also meet fundamental quality standards.

FilterSetting
Price vs 50-day SMAAbove
Price vs 200-day SMAAbove
Market cap> $500M
Revenue growth (YoY)> 5%

Both conditions together confirm that momentum is broadly positive across medium and long time frames — a durable institutional-grade filter used in many systematic strategies.

Try this screen in ScreenerHub: Price > SMA(50) →

Screener 2: Golden Cross setup

Find stocks where the 50-day SMA has recently moved above the 200-day SMA — potential early entries into new uptrends.

FilterSetting
50-day SMA vs 200-day SMAAbove
Market cap> $1B
P/E ratio5 – 30
Revenue growth (YoY)> 0%

Layering fundamental filters onto the Golden Cross narrows results to stocks where improving price momentum is backed by real business performance.


Common Mistakes When Using Moving Averages

1. Using a single moving average in isolation One MA tells you where the trend has been — not where it's going. Comparing at least two MAs (e.g., 50-day and 200-day) gives you both a medium- and long-term picture. A single MA in isolation produces too much noise to act on confidently.

2. Treating crossovers as guaranteed entry signals A Golden Cross is an observation, not a buy order. Moving averages are lagging by definition. By the time the 50-day crosses above the 200-day, a significant portion of the initial move may already be priced in. Pair crossover signals with RSI and volume to judge whether momentum is actually strong or already fading.

3. Using the wrong period for your strategy A 20-day SMA is useful for swing traders; a 200-day SMA is relevant for long-term investors. Applying a 200-day moving average filter to a short-term trading screen means you'll always be too slow — the signals will arrive long after the setup has passed. Match your MA period to your intended holding horizon.


Frequently Asked Questions

What is the difference between the 50-day and 200-day moving average?

The 50-day SMA captures medium-term price momentum — roughly two to three months of trading. The 200-day SMA reflects the long-term trend — about ten months. The 50-day reacts faster to recent price changes; the 200-day is more stable and carries more weight as a long-term support or resistance level. Because many institutional investors monitor the 200-day closely, it often becomes a self-fulfilling reference point: when price approaches it, buying or selling pressure frequently increases.

Which is better — SMA or EMA?

Neither is universally better. The SMA is smoother and better suited to long-term trend analysis where you want to avoid reacting to short-term noise. The EMA reacts faster to price changes, making it preferred for shorter-term momentum screens and entry timing. MACD — one of the most widely used technical indicators — uses EMAs internally. For stock screening aimed at long-term investment decisions, the SMA is typically the right choice. For shorter-term momentum screens, EMA filters provide earlier signals.

Can moving averages be combined with fundamental screens?

Yes — and this combination is where moving averages are most powerful for systematic investors. A stock may have excellent earnings growth and a low P/E ratio, but if it is trading below its 200-day SMA, the market has not yet started rewarding that value. Adding a "price above 200-day SMA" condition to a fundamentals-based screen filters out value traps and stocks in structural downtrends before they consume time and capital.

What moving average periods does ScreenerHub support?

ScreenerHub includes the most widely used moving average periods as screener filters: 20-day, 50-day, 100-day, and 200-day, for both SMA and EMA. You can filter for stocks trading above or below any of these levels, or screen for Golden Cross conditions, directly in the Screener Studio.