How to trade with moving averages: Basics & formula explained

Exness trading journalist

Share:
Hero image.Exness Insights moving averages@3x.png

For decades, moving averages have been used to identify market trends and make informed entry and exit decisions. Before implementing them into your trading strategy, however, it’s important to know exactly how they work.

Moving averages (MAs) have been one of the most widely used trading indicators for decades, with their simplicity being one of the key reasons for their popularity. 

In the world of trading, one of the most common challenges is market noise, which can make it difficult to spot the true direction of price movement.

However, by smoothing out price data, traders have not only been able to smooth out this noise but also gain a far clearer picture of the underlying trend and momentum of the market.

Content

  1. What are moving averages?
  2. Moving average formula explained
  3. How moving averages help in trading
  4. Popular moving average strategies
  5. Moving average strategy example: Stock trade walkthrough
  6. Best moving averages for different trading styles
  7. Tips for using moving averages effectively
  8. Is a moving average strategy right for you?
  9. Key takeaways
  10. Final thoughts on mastering moving averages

What are moving averages?

So, what are they and how do they work? Before we get into the basics, there are many different kinds of moving averages—each of which has its own strength and use cases.

ins-cta-trade-app.png

Exness Trade app

Trade with confidence anytime, anywhere.

Download now

Simple Moving Average (SMA)

The Simple Moving Average (SMA) is the most basic type of moving average, calculated by taking the arithmetic mean of a set number of past price points. For instance, a 10-day SMA adds up the closing prices of the last 10 days and divides by 10.

Exponential Moving Average (EMA)

The Exponential Moving Average (EMA) gives more weight to recent prices, making it more responsive to the latest market moves. For instance, if a stock suddenly rises after a period of sideways movement, the EMA will adjust more quickly than the SMA, reflecting the new upward momentum.

Other variants (WMA, SMMA)

There are several other moving averages to be aware of, but two of the most noteworthy are the Weighted Moving Average (WMA) and the Smoothed Moving Average (SMMA), with the WMA assigning different weights to each price, while the SMMA averages prices over a longer period.

Moving average formula explained

Just as each moving average is different, its formula is also slightly different, reflecting how it weighs past prices and responds to recent market movements. 

Simple Moving Average formula

The moving averages formula for SMA is:

SMA = (A1 + A2 + ... + An) / n

In terms of how this works, as the trader, you would choose the period—for instance, five days—add the closing prices of the last five days, and then divide by the number of periods. This then gives a smoothed value that represents the average price over that time frame.

Exponential Moving Average formula

The moving averages formula for EMA is:

EMA_Today = (Value_Today × (1 + Days / Smoothing)) + EMA_Yesterday × (1 − (1 + Days / Smoothing))

Here, the EMA calculates a weighted average that gives more importance to recent prices. As a trader, you choose how many days you want to calculate, determine the smoothing factor—this is usually based on the number of days—and then combine the day’s price with the previous day’s EMA. This then allows the EMA to react more quickly to recent price movements while still taking past data into account.

Which formula should beginners use?

If you're a beginner, the formula you use will depend on your trading goals and the level of responsiveness you want. As mentioned before, the SMA is the simplest MA, but EMA is excellent for responsiveness, which can be useful if you’re short-term trading or simply trying to spot trends early.

How moving averages help in trading

There are other benefits to consider when making this decision. MAs aren’t just tools for calculating averages; they help traders carry out a number of key functions, each of which has its own role in identifying trends and timing entry and exit points effectively.

Identifying trend direction

One of the primary uses of MAs is to identify the direction of a trend. When you’re trading the stock market, it’s not enough to simply know a trend is taking place; you have to determine its strength and decide whether it’s a good opportunity to enter a position. In this case, a rising moving average indicates an uptrend, while a falling moving average signals a downtrend.

Chart showing how the Smoothed Moving Average (SMMA) follows Apple’s price trend, demonstrating how moving averages smooth market noise.
Here, you can see the SMMA rising and falling along with the price of AAPL, which is a clear illustration of how the MA is following the trend.

Using MAs as dynamic support and resistance

MAs can also act as dynamic support or resistance levels. In an uptrend, for instance, prices often pull back to a moving average before bouncing even higher, making the MA a potential support level. Conversely, in a downtrend, a falling MA might act as resistance, with prices often retreating after touching it.

Trading chart showing 9-day Exponential Moving Average (EMA) crossover signals illustrating the moving averages formula in a sideways market.
Here, you can see a 9-day EMA. When the price moves above the EMA, it generally indicates short-term bullish momentum, but when it moves below, that suggests the market is bearish. In this case, frequent crossing over and under the EMA signals a sideways or choppy market.

Spotting crossovers

Spotting crossovers can also be done using the “golden cross”, which occurs when a short-term MA crosses above a long-term MA, typically signalling a bullish trend. On the other hand, a “death cross” can happen when a short-term MA crosses below a long-term MA, suggesting the market has become bearish and that traders may want to consider exiting their long positions.

Example of a golden cross where the short-term moving average crosses above the long-term moving average, applying the moving averages formula for bullish trends.
Here is an example of a golden cross, when the short-term SMMA (50-periods) crosses above a long-term SMMA (200-periods).
Trading chart showing a death cross where a short-term moving average crosses below a long-term moving average using the moving averages formula.
Here is an example of a death cross, when the 50-period SMMA crosses below the 200-period SMMA.

Popular moving average strategies

Using MAs practically involves a bit of experimentation. Again, it all depends on your risk tolerance and preferred timeframe, but there are a few different strategies you can look into that might suit your trading style.

Single Moving Average strategy

The Single Moving Average strategy is the simplest approach to determine the overall direction of the market. When the price is above the moving average, it indicates an uptrend and potential long positions, but when the price is below, it signals a downtrend and potential short positions.

Moving average crossover strategy

While the above strategy is best for beginners, the moving average crossover strategy is a strong choice for traders looking to capture trend reversals quickly. By using a short-term MA, like the 50-period EMA, and a long-term MA, like the 200-period EMA, crossovers can provide clear entry and exit signals, with a golden cross signaling a potential bullish trend and a death cross indicating a potential bearish trend.

Combining MAs with RSI or MACD

Avoid using MAs in isolation. All data points and indicators need others to make sense of them. No matter what strategy you’re going for, combining your moving averages with indicators like RSI or MACD can help to confirm signals and reduce false entries, ensuring that each indication is backed by another. 

Strategy

How it works

Best use scenario

Single Moving Average

Uses one MA (50-period SMA or 20-period EMA) to identify trend direction.

Beginners, trend-following in stable markets.

Moving average crossover

Uses a fast MA (short-term) and a slow MA (long-term). A bullish signal occurs when the fast MA crosses above the slow MA, and a bearish one occurs when it crosses below.

Trend reversal detection, capturing new trends quickly for medium to long-term trading.

MAs with RSI or MACD

Uses MA signals in conjunction with momentum indicators. For instance, a bullish crossover is confirmed by an RSI above 50 or the MACD trending upward.

Reducing false signals and improving trade confirmation in volatile markets.

Moving average strategy example: Stock trade walkthrough

With this in mind, let’s walk through a practical example of a stock trade using a moving average crossover. In this case, we’ll use a 4-hour MSFT stock, looking for a moving average crossover to identify our entry and exit points.

Step 1: Spot the 50/200 crossover

First, look for a golden cross, where the 50-period MA crosses above the 200-period MA.

Microsoft stock chart showing a 50/200 moving averages crossover (golden cross) as an entry signal using the moving averages formula.
On 6 December at 20:00, you can see the 50-period MA cross above the 200-period MA, indicating MSFT is entering a potential bullish trend.

Step 2: Confirm the trend with the price holding above MA

Next, ensure that the price continues to stay above the 50-period MA, confirming that the trend is sustaining.

Step 3: Exit when the price closes below MA

Lastly, plan your exit when the price closes below the 50-period MA, as this signals a potential weakening of the trend.

Example of exit signal when MSFT price falls below the 50-period moving average, demonstrating moving averages formula in trend confirmation.
An ideal exit would have been on 23 December at 12:00, as the price clearly dropped below the 50-period MA.

Best moving averages for different trading styles

The image above is a simple example of SMMA, but as we mentioned before, different trading styles will require different moving averages.

Day trading with short-term EMAs

If you’re a day trader, for instance, you’ll need quick signals, like the 9-period or 21-period EMA. This will help you react quickly to intraday price movements, allowing you to identify potential entry or exit points quickly.

Swing trading with medium-term MAs

If you’re a swing trader, however, you might use medium-term moving averages, such as the 50-period SMMA or EMA, confirming trends over several days to weeks.

Long-term investing with 200 SMA

On the other hand, long-term investors might prefer the 200-period SMA, which is a widely used benchmark for big-picture market positioning, helping to identify major trends and serve as a guide for holding or adjusting positions over months or years. 

Tips for using moving averages effectively

Before you decide on any MA or strategy, however, it’s important to bear in mind a few things:

  • Choose MA periods that fit your timeframe: Remember, choose MA periods that fit your timeframe, as failing to do so could easily lead to misleading signals and poor trade timing.
  • Avoid whipsaws in ranging markets: Avoid whipsaws in ranging markets, which are false signals caused by the price moving back and forth around the moving average.
  • Combine MAs with price action for confirmation: Always combine MAs with price action for confirmation first, before you make any trading decisions.
  • Backtest settings before going live: Lastly, be sure to backtest your settings in a demo account before going live, as this will give you the best chance of finding the most effective MA periods and strategy for your market.

Is a moving average strategy right for you?

So, is a moving average strategy right for you? If you’re a beginner, then definitely yes. Moving average strategies are best suited for newcomers in the stock market, mainly due to their simplicity and ease of understanding—not to mention, they’re versatile and work across multiple markets, including forex, stocks, and cryptocurrencies. 

They can be less effective in choppy or sideways markets, so if you’re planning on trading frequently in such conditions, make sure you use those other indicators to avoid losses.

ins-cta-indicators.png

Make smarter trading decisions

Use expert analysis and tools on demo accounts or a live account.

Try now

Key takeaways

  1. Moving averages help traders smooth out price data and reveal market trends. By averaging closing prices over a specific time period, moving averages reduce short-term fluctuations and highlight the underlying trend in stock prices.
  2. The Simple Moving Average (SMA) gives equal weight to all data points. Calculated using the arithmetic mean of past closing prices, the SMA offers a constantly updated average price that helps traders identify upward or downward trends in financial markets.
  3. The Exponential Moving Average (EMA) gives more weight to recent data. Unlike the SMA, the Exponential Moving Average formula emphasizes recent price moves, making it more responsive to new data and helping technical traders capture early momentum shifts.
  4. Different moving averages serve different trading purposes. From the weighted moving average (WMA) to the smoothed moving average (SMMA), each variation applies different weights to data points, helping traders fine-tune their analysis based on volatility and timeframe.
  5. Moving averages act as dynamic support and resistance levels. When plotted on price charts, MAs can show where prices may bounce (support) or pull back (resistance), giving traders visual cues for entry and exit points based on price action.
  6. Crossovers between moving averages provide powerful trading signals. A bullish crossover (golden cross) happens when a short-term MA crosses above a long-term MA, while a bearish crossover (death cross) occurs when it crosses below—both key signals for trend direction changes.
  7. The moving averages formula is essential for technical analysis accuracy. Whether using the SMA or the exponential moving average EMA, understanding how the average calculation works helps traders make more informed decisions and avoid misleading signals.
  8. Traders should choose time periods that match their trading style. Short-term traders often prefer 9- or 21-period EMAs for quick reactions, while long-term traders rely on the 200-period SMA to identify the broader market trend and reduce noise.
  9. Moving averages are lagging indicators but still vital for trend confirmation. Because they’re based on past price data, moving averages don’t predict moves but confirm them—helping traders spot sustained momentum and filter out random short-term fluctuations.
  10. Combining moving averages with other indicators improves accuracy. Pairing MAs with tools like RSI or MACD adds confirmation, ensuring signals are supported by momentum data and strengthening overall technical analysis.

Final thoughts on mastering moving averages

Whether you’re a beginner or an experienced trader, moving averages can be beneficial. However, test them out and practice in a risk-free demo account before risking funds. Start with one MA, explore crossovers, and eventually, you’ll see for yourself how they can smooth noise, reveal trends, and provide your entry and exit cues.

Share:

Related


Trading Pro Q&A: What do you think is the worst indicator?

Trading Pro Q&A

Hero image.Exness Insights the worst trading indicator@3x.png

Understanding CFDs: What is CFD trading and how does it work

Trading basics

Hero image.Exness Insights What are CFDs@3x.png

Fundamental vs technical forex analysis

Fundamental analysis

Hero image.Exness Insights fundamental analysis forex@3x.png

How to spot the bearish pennant setup

Charts & patterns

Hero image.Exness Insights Bearish pennant@3x suffix.png

Exness Trade app

Trade with confidence anytime, anywhere.

Ios
Ios
Android
Android
Android
AndroidApk
AndroidApk
AndroidApk
Screenshot 2024-06-17 at 09.51.20.jpg

Trading is risky. T&Cs apply.

More in Essential learning


Hero image.Exness Insights What are CFDs@3x.png

Trading basics

Understanding CFDs: What is CFD trading and how does it work
Hero image.Exness Insights fundamental analysis forex@3x.png

Fundamental analysis

Fundamental vs technical forex analysis
Hero image.Exness Insights Bearish pennant@3x suffix.png

Charts & patterns

How to spot the bearish pennant setup
Hero image.Exness Insights how to start forex trading as a beginn@3x.png

Trading basics

How to start forex trading as a beginner
exness-insights-cta-desktop.jpg

Trade with a trusted broker today

Start trading