Simple, Exponential, and Weighted Moving Averages

Day Trading Uses and Applications of Moving Averages

example of sma, ema, and wma on price chart
Photo: TradingView.com

Moving averages act as technical indicators that show the average price movement over a certain period. They are often used to help highlight trends, spot trend reversals, and provide trade signals.

There are several different types of moving averages. They each create a line on a chart that can help show you which direction a price is moving.

Learn the different types of averages used by traders and what they tell you about a price.

Simple Moving Average Calculation

The simple moving average (SMA) calculates an average of the last n prices, where Px represents the price in a period, and n represents the number of periods. The average "moves" because you are not using all of the data, only recent periods:

Simple Moving Average

For example, a four-period SMA with prices of 1.2640, 1.2641, 1.2642, and 1.2641 gives a moving average of 1.2641 using the calculation (1.2640 + 1.2641 + 1.2642 + 1.2641) / 4 = 1.2641.

While knowing how to calculate a simple average is a good skill to have, trading and chart platforms figure it out for you. You select the SMA indicator from the list of charting indicators and apply it to the chart. Then you adjust the number of periods you want to use.

You typically make adjustments to the indicators in the Settings menu section of a trading platform.

Note

On many platforms, you can locate the settings by double-clicking on the indicator itself.

The advantage of an SMA is that you know what you are getting. The SMA value equals the average price for the number of periods in the SMA calculation.

Traders commonly used eight, 20, 50, 100, and 200 periods for an SMA. For example, if using a 100-period SMA, the current value of the SMA on the chart is the average price over the last 100 periods or price bars.

Some charts include the SMA, along with an exponential moving average (EMA). They can also have a weighted moving average (WMA) on a one-minute stock chart. Due to their different calculations, the indicators appear at different price levels on the chart.

Exponential Moving Average Calculation

The exponential moving average (EMA) is a weighted average of recent period's prices. It uses an exponentially decreasing weight from each previous price/period. In other words, the formula gives recent prices more weight than past prices.

Exponential Moving Average

For example, a four-period EMA has prices of 1.5554, 1.5555, 1.5558, and 1.5560. The last value is the most recent and gives a current EMA value of 1.5558.

The EMA adapts more quickly to price changes than the SMA does. For example, when a price reverses direction, the EMA will reverse direction more quickly than the SMA will, because the EMA formula gives more weight to recent prices and less weight to prices from the past.

Note

As with the SMA, charting platforms do all of the EMA calculations for you. Select the EMA from the indicator list on a charting platform, and apply it to your chart. Go into the settings, and adjust how many periods the indicator should calculate, such as 15, 50, or 100.

Weighted Moving Average Calculation

The weighted moving average (WMA) gives you a weighted average of recent prices, where the weighting decreases with each previous price. This works similarly to the EMA, but you calculate the WMA differently.

Weighted Moving Average

WMAs can have different weights assigned based on the number of periods used in the calculation. If you want a weighted moving average of four different prices, then the most recent weighting could be 4 to 10. The previous period could weigh 3 to 10. The third period could have a weighting of 2 to 10.

A weight of 4 to 10, for example, means that you have 10 recent periods and their prices. You choose the four most recent prices. This accounts for 40% of the value of the WMA. The price four periods ago only accounts for 10% of the WMA value.

For the following example, assume prices of 90, 89, 88, 89, with the most recent price first. You would calculate this as [90 x (4/10)] + [89 x (3/10)] + [88 x (2/10)] + [89 x (1/10)] = 36 + 26.7 + 17.6 + 8.9 = 89.2

Note

You can customize the weighted moving average more than the SMA and EMA. The most recent price points are usually given more weight. It could also work the other way, where you give historical prices more weight.

Moving Average Trading Uses and Interpretation

You can use moving averages for both analysis and trading signals. For analysis, all of the moving averages help highlight the trend. When the price is above its moving average, it shows that the price is trading higher than it has, on average, over the period being analyzed. That helps to confirm an uptrend. When the price sits below its moving average, the price is trading lower on average than it has over the period being analyzed. That helps to confirm a downtrend.

When the price crosses above its moving average, it is getting stronger relative to where it was in the past, because the most recent price now sits higher than the average. If the price crosses below its moving average, it is getting weaker relative to where it was in the past.

One longer-term and one shorter-term moving average—for example, 20 and 50 periods—can be added to a chart simultaneously. When the 20-period moving average crosses above the 50 line, it indicates that short-term price momentum is moving to the upside. When the 20-period moving average crosses below the 50 line, it suggests that the short-term price momentum is moving to the downside.

Note

Moving averages can also be incorporated with other indicators to provide trade signals.

An EMA can provide buy signals when combined with Keltner Channels, an indicator with a high, average, and low price that creates a "channel" on a chart. A strategy may include buying near the EMA when the trend is up, and the price is pulling back from the top of the Keltner Channel.

One type of moving average isn't inherently better than others; they calculate the average price differently. Depending on the strategy you’re using, one kind of moving average may work better than another. Try out different moving average combinations, and see which provides you with the best results.

You may find that, for each market, you need to adjust your settings slightly. A 50-period SMA may provide great signals on one stock, for example, but not on another. A 20-period EMA may help isolate the trend on one futures contract but not another. All of the moving averages are just tools, and interpreting them is up to the trader, because no indicator works well all the time or in all market conditions.

Frequently Asked Questions (FAQs)

How do you add moving average to a chart?

Moving averages are a technical indicator, so look for the button that lets you add indicators. This may be in a settings menu, or it may be its own button. From there, you can choose between simple, exponential, and weighted moving averages. Once the moving average is added to the chart, you can alter the number of periods, whether it uses the close or the low of the day, and other factors along these lines.

How should you format moving averages for swing trading?

Swing traders often use a mix of short-term and mid-term moving averages. For instance, a trader may use an 8-day, 24-day, and 50-day moving average. Other traders may use a 6-month moving average or more, in addition to a shorter-term moving average.

Was this page helpful?
Related Articles