A moving average is the average closing price of the last few bars, recalculated on every new bar so the line slides along with the chart. It hides small wiggles and shows which way price has been leaning. Because it only uses past closes, it always trails price. This hub explains the idea, walks through one example by hand, and links every moving average guide on the site.
Quick read
Formula
Simple version: add the last n closes, divide by n.Common lengths
9, 10, 20, 21, 50, 100 and 200 barsMain families
Simple (SMA), exponential (EMA), weighted (WMA), smoothed (SMMA)Best use
Seeing the direction and slope of a trendMain weakness
Lags price and flips back and forth in a sideways marketFirst value
Appears only after n bars of history exist
What is a moving average in trading?
Picture the last 20 closing prices written on a card. Their average is one dot. When tomorrow's bar closes, the oldest price falls off the card, the new one joins, and you plot a fresh dot. Join the dots and you have a 20 period moving average. In trading it answers a simple question: over the window I chose, has price been rising, falling or going nowhere?
The window is counted in bars, not days. A 20 bar line on an hourly chart covers 20 hours; drawn on daily candles it spans roughly four weeks of sessions. That is why the same setting feels fast on one chart and slow on another.
The moving average meaning is the same in a stock market, a currency pair or a commodity: it is a smoothed record of past closes, nothing more. It does not predict. It describes.
How to find a moving average by hand
You only need addition and division. Take five daily closes: 104.20, 105.10, 104.70, 106.00 and 106.50. For a 3 day simple moving average:
- Add the first three closes: 104.20 + 105.10 + 104.70 = 314.00. Divide by 3: 104.67.
- Slide one bar: drop 104.20, add 106.00. The sum is 315.80, so the average is 105.27.
- Slide again: drop 105.10, add 106.50. The sum is 317.20, so the average is 105.73.
Three dots, each a little higher, tell you the short trend is up. That is the whole moving average example. Weighted and exponential versions change how much each close counts; the moving average formula page works all three through the same set of numbers, with a calculator.
Using the interactive chart above
The chart widget at the head of this hub plots an invented price series carrying a moving average. Switch the line on, then drag the length slider. A short way to see the effect in numbers: if the last 20 closes on the chart add up to 2,454.00, a 20 period simple average sits at 2,454.00 / 20 = 122.70. Slide the length to 50 and the line now averages 50 closes, so it drifts further below price in a rally and turns later.
- Press new example a few times. In trending series the line slopes cleanly; in choppy ones the candles slice through it over and over.
- Try a short and a long length on the same series and watch which one gives fewer crosses.
- Notice that every turn in the line comes after the turn in price, never before it.
Reading a moving average chart: four things to check
Most traders read the line in this order:
| What you look at | What it suggests | Where it misleads |
|---|---|---|
| Slope of the line | Rising line, rising average price over the window | Flat slopes happen in quiet ranges and say little |
| Price above or below | Closes above a rising line point to an uptrend | In a range price sits on both sides within days |
| Distance from price | A wide gap means price ran far from its average | Price can stay stretched for a long time |
| Two lines crossing | A short line crossing a long line hints at a change | Crosses come late and many reverse quickly |
In the chart above, the bearish cross at bar 52 arrived when the pullback was nearly over, and the bullish cross at bar 65 came well after the low. Price closed the series at 118.85, so a trader who sold the first cross was on the wrong side. That is the normal cost of a lagging tool. The moving average crossover guide tests this pattern in more detail.
Daily moving average and the DMA label
A daily moving average is just the line drawn on daily candles. People often shorten it to DMA, so a 200 DMA means the average of the last 200 daily closes. Be careful: some charting apps also use DMA for a displaced moving average, which is a line shifted forward or back by a few bars. Check which one your settings panel means.
The two best known daily lines are the 50 day moving average and the 200 day moving average. When the 50 crosses above the 200, people call it a golden cross; the reverse is a death cross. Both need months of daily bars to form, so they confirm a trend late rather than catch its start.
A daily line also struggles when the market has no trend. In the example below price drifted in a range between about 240.81 and 259.60, and closes crossed the 20 DMA 15 times in 70 bars. Every one of those crosses resembled a signal; hardly any led anywhere.

Stocks, currency pairs and crypto: same math, different clocks
The math is identical across markets; the calendar is what differs. A stock exchange is open on weekdays only, so 200 daily bars cover roughly nine and a half months of sessions. Crypto coins trade every day, so 200 daily bars there cover about six and a half months. Currency pairs trade day and night from Monday to Friday, which means a 20 bar line on a 1 hour chart spans less than one trading day.
| Length | Typical job | Feels like |
|---|---|---|
| 9 or 10 | Short swings, fast trigger lines | Close to price, many crosses |
| 20 or 21 | Pullback zone in a trend | About one month of daily bars |
| 50 | Medium trend filter | Slow enough to ignore most noise |
| 100 | Between medium and long | Rarely touched in strong trends |
| 200 | Slow filter for daily trends | Turns only after big moves |
There is no single best length. Some people run three lines at once, for example 10, 20 and 50, and only act when all three point the same way. The best moving average settings page compares lengths by time frame.
A 3 year moving average example from statistics
Students meet the same tool under the name moving average method. Take seven yearly figures for a factory, in thousands of units: 21, 24, 22, 27, 30, 28, 33. A 3 yearly moving average averages each run of three years and writes the result against the middle year:
| Years averaged | 3 year total | Average (placed at) |
|---|---|---|
| 1 to 3 | 67 | 22.33 (year 2) |
| 2 to 4 | 73 | 24.33 (year 3) |
| 3 to 5 | 79 | 26.33 (year 4) |
| 4 to 6 | 85 | 28.33 (year 5) |
| 5 to 7 | 91 | 30.33 (year 6) |
The dips in years 3 and 6 vanish and a steady climb of 2 units a year appears. A 5 yearly moving average works the same way with five years per window. Traders put the average on the latest bar instead, which is why a trading line lags and a centered statistics line does not. Read the moving average method page for even windows and seasonal data, and the Excel guide builds both versions in a sheet. If you work in a database, the SQL form is a window function: AVG(close) OVER (ORDER BY day ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) gives a 3 row trailing average.

Every moving average guide on this site
Each page below takes one line or one use and goes deep, with its own worked numbers. If you are new, read the basics row first.
| Group | Pages | Start here if you want to |
|---|---|---|
| Basics | Moving average formula, Types of moving averages, SMA vs EMA | do the math by hand and pick a family |
| Core lines | Simple, Exponential, Weighted, Smoothed, Triangular | understand the five lines most charts offer |
| Less lag | Hull, Double exponential, Triple exponential, Zero lag EMA, Arnaud Legoux | follow price faster and accept more overshoot |
| Adaptive and special | Kaufman adaptive, Jurik, Volume weighted, Volume moving average, Displaced, Guppy multiple | adjust to volatility, add volume or read many lines at once |
| Using the lines | Crossover, Trading strategy, 50 day, 200 day, Best settings | turn a line into rules you can test |
| Data and statistics | Moving average in Excel, Moving average method (time series) | smooth sales, rainfall or exam data, or build a sheet |
When the line fails, and a word on risk
A moving average works best in a market that trends for many bars. In a sideways range it does the opposite of what you want: price crosses it from above, then from below, then from above again, and every cross looks like a signal. A longer length gives fewer false crosses but turns even later after a real reversal. No setting removes this trade off.
A leveraged position can shrink faster than the cash behind it, and regulators find that the majority of everyday clients in leveraged forex and CFD products lose. Rehearse any moving average rule on archived price history, or in a demo account, before money is involved. Treat this hub as schooling rather than financial advice; a regulator's plain overview sits on the Investor.gov technical analysis page.
Questions traders ask
What is a moving average in the stock market?
Think of it as the average closing price of a share over the last chosen number of sessions, updated each day. A 50 day line, for example, averages the last 50 closes. Traders use it to judge whether the price has been trending up or down, not to forecast the next move.
What is the moving average indicator used for?
Mainly to show trend direction and to smooth out noise. People also watch price pulling back to the line, the slope of the line, and crosses of a quick line over a slower one. All of these signals come after price has already moved.
What does DMA mean in a moving average?
In most trading talk DMA stands for daily moving average, so a 200 DMA is the average of 200 daily closes. Some charting apps use the same letters for a displaced moving average, a line shifted forward or back. Check your settings panel to see which one you have.
How do you find a moving average?
Add the last n closing prices and divide by n. Step forward a bar, swap the oldest close for the newest one and divide again. Repeat for every bar and join the results into a line.
Does a moving average work on crypto charts?
The math is identical, and many crypto traders use the same 20, 50 and 200 lengths. Coins change hands seven days a week, so a 200 day line spans fewer months than it does on a stock chart. Sharp swings also cause more false crosses.
What is a 3 year moving average?
Each run of three yearly figures is averaged and the result is written against the middle year. It smooths short ups and downs so the longer trend shows. It is a common first exercise in statistics classes on time series.
