A moving average is a line on your chart that shows the average closing price over a set number of recent periods, which smooths out the noise so the underlying direction is easier to see. The two versions most beginners meet are the simple moving average (SMA) and the exponential moving average (EMA), and the difference between them comes down to how much weight they give to the latest prices.
What is a moving average?
Price jumps around from candle to candle. A moving average replaces that jagged path with a single smooth line. Each time a new candle closes, the oldest value drops out of the calculation, the newest one comes in, and the line moves forward. That is why it is called "moving".
The number you choose, such as 20 or 50, is the period. A short period reacts quickly but wobbles more. A long period is smoother but slower to respond. Neither is better in general; it depends on how quickly you want the line to react.
A moving average describes what price has already done. It does not tell you what will happen next.
How is a simple moving average (SMA) calculated?
The SMA adds up the closing prices over the chosen period and divides by the number of periods. Every price carries the same weight.
Here is a worked example with round, illustrative numbers. Suppose the last five daily closes on EUR/USD are 1.1000, 1.1010, 1.1020, 1.1030 and 1.1040. These figures are made up to show the arithmetic, not a view on the market.
- Add them up: 1.1000 + 1.1010 + 1.1020 + 1.1030 + 1.1040 = 5.5100
- Divide by 5: 5.5100 ÷ 5 = 1.1020
The 5-period SMA is 1.1020. If tomorrow closes at 1.1050, the 1.1000 drops out, the new price comes in, and the SMA becomes 1.1030.
How is an exponential moving average (EMA) different?
The EMA also averages recent prices, but it gives more weight to the newest ones. Older prices still count; they just count for less and less as they age. Your charting platform does the maths, so you never need to work it out by hand.
The practical effect is that the EMA hugs price more closely and turns sooner than an SMA with the same period. In the example above, a big jump on the latest day would pull the EMA up faster than the SMA.
- SMA: smoother, slower, treats every period equally
- EMA: quicker, more sensitive, favours recent prices
The faster reaction is both the strength and the weakness of the EMA. It spots a change in direction earlier, but it also gets fooled by short-lived spikes more often.
How do traders use moving averages?
Moving averages are rarely used alone, but there are a few common ways to read them.
- Trend direction. If price sits above a rising moving average, the trend is generally seen as up. If it sits below a falling one, the trend is seen as down.
- Dynamic support and resistance. In a steady trend, price often pauses near a moving average such as the 50-period before carrying on. Traders treat it as a moving zone, much like the horizontal levels in support and resistance.
- Crossovers. When a short-period average crosses a longer one, some traders read it as a possible shift in momentum. A 20-period line crossing above a 50-period line is a typical example.
Crossovers lag by design, because both lines are built from past prices. In a sideways market they cross back and forth again and again, producing false signals. That is why many traders pair them with a momentum tool from the trading indicators library and confirm what they see before acting.
Which period and type should you use?
There is no magic setting. Some common starting points are:
- 9 or 20 periods for short-term views
- 50 periods for a medium-term view
- 200 periods for the long-term backdrop
Choose a type and a period, then keep them the same long enough to learn how they behave on your chosen market and timeframe. Constantly changing the settings until the past looks perfect is called curve fitting, and it usually fails on new data.
Remember too that every indicator has limits. The technical analysis guide explains why one tool should support your decisions rather than make them for you. And because leveraged products can move against you quickly, read the risk warning before putting real money behind any idea.
What to do next
The best way to learn is to see the lines move on a live chart without risking money. Open a demo account, add a 20-period EMA and a 50-period SMA in MetaTrader 5 (both are built in), and watch how each reacts around turning points over a week or two. Note where they helped and where they misled you. A small journal of those observations teaches more than any definition.
DMA Capitals offers MetaTrader 5 on Windows, macOS, Android and iOS, plus a Web Trader, so you can practise on whichever device is handy.
This article is general education, not investment advice. CFDs are leveraged products and you can lose more than you expect; read our risk warning.