What you will learn

Learn with charts how simple and exponential moving averages are calculated and what to watch out for with golden and death crosses.

Moving average examplesSample data · not a real stock

What to look forAs a falling price turns, find where the 20-day line (orange) crosses above the 60-day line (purple) — a golden cross.

CautionThe cross appears after the price has already risen quite a bit. Moving averages always lag the price.

1260 bars · 2018-11-26 – 2023-09-22
On price
Lower panes
Auto

Sample (synthetic) data: not a real stock or real prices, but prices generated to explain the idea. Drag the chart to move through time and use the wheel or two fingers to zoom.

Concept

Daily prices swing a lot, so the trend is hard to see at a glance. A moving average recalculates the average close of the last N days every day and joins those values, filtering out short swings to show the direction.

In the chart above, press the settings button next to Moving avg to open a list of moving averages, as in real charting software. For each line you can set visibility, period, type (simple, exponential, weighted), color, width and opacity, and Add line lets you add up to 10. Switch the 20-day line to “EMA” and you will see the exponential average turn first when the price changes direction. The defaults (5/20/60/120-day SMAs) are common on Korean charts, and your settings are saved in this browser and apply to other charts too.

How it is calculated

SMA(N)ₜ = (Pₜ + Pₜ₋₁ + … + Pₜ₋ₙ₊₁) ÷ N

α = 2 ÷ (N + 1) EMA(N)ₜ = α × Pₜ + (1 − α) × EMA(N)ₜ₋₁

Cautions when reading it

Chart shapes and indicators summarize past prices. The same shape is sometimes right and sometimes wrong depending on the market, and this page does not tell you when to buy or sell any stock. To practice yourself, try the chart lab or mock trading.

Quick quiz 3 questions

  1. How is a 20-day simple moving average calculated?
  2. What happens if you use a longer moving average period?
  3. What is it called when a short moving average crosses above a long one?
0 / 3 answered

All learning steps · Glossary · Stock textbook (Korean)