Skip to content

What Is a Moving Average in Trading [Hands-On]

What is a moving average in trading? Calculate SMA and EMA yourself, spot the drop-off trap, and use simple rules that actually work for beginners.

6 min readBeginner

One loud day on a chart can feel like a reversal when it’s just noise. A moving average in trading exists for that mess: compress a choppy close series into a smoother line so direction shows up without tick-by-tick staring.

Think of a rolling average on a spreadsheet column of closes. New close lands, oldest drops out (or gets down-weighted). That’s the mechanism. Below you calculate it yourself, read it on a chart, and hit the traps that wipe beginners out.

Hands-on: calculate a moving average in trading

Five closes (made-up, realistic): 102.40, 101.10, 103.75, 104.20, 103.50. Goal: 5-period simple moving average (SMA), then how an exponential moving average (EMA) differs.

Step 1 – Simple moving average

SMA is the arithmetic mean of the last n closes – same definition you’ll see in CME and Investopedia primers.

SMA_5 = (102.40 + 101.10 + 103.75 + 104.20 + 103.50) / 5
 = 514.95 / 5
 = 102.99

Next day closes 105.00. Drop 102.40, add 105.00:

SMA_5 = (101.10 + 103.75 + 104.20 + 103.50 + 105.00) / 5
 = 517.55 / 5
 = 103.51

Charting software just plots each point as a line. Want another worked strip of futures closes? CME Group’s moving-average lesson uses the same sum-and-divide steps.

Step 2 – Exponential moving average (the responsive cousin)

EMA weights recent prices harder. Multiplier = 2 / (period + 1). For 5 periods: 2 / 6 ≈ 0.3333.

Seed the first EMA with the SMA (common practice), then:

EMA_today = (Close × 0.3333) + (EMA_yesterday × (1 - 0.3333))

Seed yesterday at 102.99, today closes 105.00:

EMA = (105.00 × 0.3333) + (102.99 × 0.6667)
 ≈ 34.997 + 68.664
 ≈ 103.66

103.66 sits nearer the new print than the new SMA (103.51). That gap is the whole reason people bother with EMA. Twenty-period multiplier lands near 0.0952; ten-period near 0.1818 – same 2/(n+1) form on StockCharts ChartSchool and Investopedia.

Pro tip: Spreadsheet or code an EMA with lots of warm-up bars. Each value embeds every prior EMA, so a short seed is wrong early on. StockCharts is explicit: short history hurts accuracy; their charts commonly warm 250+ bars so the line settles to a fraction of a penny.

Step 3 – Put it on a chart and read three simple rules

  1. Direction of the MA – Rising MA = average prices climbing (uptrend bias). Falling = downtrend bias.
  2. Price vs MA – Holds above a rising MA often means buyers still dominate; repeated closes under a falling MA favor sellers.
  3. Fast vs slow cross – Shorter MA crossing above a longer one is read as bullish momentum. The textbook 50-day above 200-day is the golden cross; opposite print is the death cross. Both lag. Treat them as confirmation, not a crystal ball.

Lengths you’ll trip over constantly: 10/20 for short noise cuts, 50 for swing structure, 100/200 for longer regime. No magic period – match n to how long you actually hold.

Common pitfalls to avoid

SMA drop-off bites people who only glance at the line. Day -5 spiked to 120; the other four days hugged 100. That spike still hauls the 5-SMA upward. The session it finally rolls out, the SMA can lurch down even if price barely budged. Not a fresh trend shift – arithmetic. EMA softens this because old prints decay instead of keeping equal weight until exit.

Whipsaws are the other classic failure mode. Sideways range: price and short MAs cross over and over. You buy the up-cross, sell the down-cross, and leak fees and stops. Double-crossover systems look great after a real trend appears and spit false signals when it doesn’t (StockCharts states this plainly). Practical filters: take long crosses only when price or the fast MA already sits above a much slower MA, or demand the cross hold 2-3 bars.

Period conflict is quieter. A 20-MA can yell “up” while the 200-MA still rolls over from an older bear leg. Two horizons, two answers. Pick the horizon you trade before you click.

If MAs feel like a rear-view mirror, that’s fair. They describe what average price has been doing; they never promise the next candle. Solvent traders keep them as context, not a lone trigger.

What results look like in practice

Setup Typical behavior When it helps
Price above rising 50-SMA Pullbacks toward the MA often get bought Confirmed uptrends
10/50 EMA cross Faster entries, more noise Active swing or day structure
50/200 SMA cross Late but durable regime shift Position / long-horizon bias
MA alone in a tight range Repeated false breaks Usually doesn’t help

Your edge is rarely “the cross itself.” Pair the average with hard risk limits and a market that is actually trending. Pure MA rules without a trend filter are where most beginner ledgers go red – costs and whipsaws do the damage, not the formula.

When not to use a moving average

Range-bound tape (oscillating between two levels, no higher highs/lows)? Pure MA signals churn. Major news that can gap through any average? Don’t let the line be your only tool. Holding two days while worshipping a 200-day cross? You’re reacting to last month’s story.

Mean-reversion process – buy extremes, fade stretches – sits at odds with a trend-following MA. Different job. Different tool.

Ever notice how the same 50-day line everyone watches turns into a self-fulfilling magnet on indexes? Crowd effect is real. Crowding also fails when liquidity vanishes. No tidy answer – just know you are not alone staring at it.

FAQ

What is a moving average in trading in one sentence?

A rolling average of price (usually closes) that dampens short-term noise so trend direction is easier to see. Formulas and variants: Investopedia’s MA overview.

SMA or EMA – which should a beginner start with?

SMA. Rebuild it in a spreadsheet in two minutes and you will see lag with your own eyes. After that, flip the same period to EMA and watch how much earlier it turns. Plenty of traders park SMA on the long anchors (50/200) and EMA on faster tactical lines – preference, not law.

Do golden and death crosses actually work?

They label a shift between short- and long-term average pressure, most often 50- vs 200-day. Because both lines lag, the cross often prints after a sizable move is already underway. Chop without a sustained trend? Failure rate climbs. Use them as regime tags or confirmation beside structure/volume – not as autopilot entries. Pattern definitions sit on the golden-cross page linked in Step 3.

Next action: Open any free chart, add a 20-SMA and a 50-SMA on a daily stock or ETF you know, and mark the last three times price crossed the 20 while the 50 was rising vs falling. One sentence on which context produced cleaner follow-through. That 10-minute drill beats another hour of theory.