What is a moving average?
Technical analysis in trading consists of analysing past prices statistically and mathematically and using the results to forecast future prices. One of the most popular tools for this is the moving average (MA).
The moving average is a technical indicator that follows the price with a lag, meaning that it generates a signal after the trend has changed. The moving average smooths out individual highs and lows in the price, making it easier to see the overall trend. The MA also filters out noise (random market volatility and corrections) and helps the trader decide which positions to enter and trade according to the trends.
The simplest trading strategy that uses the moving average consists of buying an asset when its price crosses the MA line from below and selling it when it crosses the MA line from above.
Variations of the Moving Average
In order to make the forecasting more precise and to reduce the number of false signals, several modifications of the simple MA have been developed:
- Simple (SMA) — SMA is the easiest moving average to construct. SMA is the average price of an asset over a specified period.
- Exponential (EMA) — more sensitive than the SMA because it gives more weight to more recent prices; used to analyze short-term trends. Also referred to as Weighted moving average(WMA) .
- Volume-weighted (VWMA) — takes into account not only the changes of the price but also those of the volume.
- Kaufman’s adaptive moving average (AMA or KAMA) — uses a dynamic smoothing constant that is sensitive to market volatility.
- Corrected average (CA) — reacts to the current market volatility but ignores incoming signals when the trend is weak.
- Hull moving average (HMA) — virtually eliminates the lag and can assume two different colors depending on the direction of the trend.
- Arnaud Legoux moving average (ALMA) — designed to solve the issues of insufficient smoothing and sensitivity found in many other MA types; can be used as a dynamic support/resistance level.
- Least square (LSMA) — tries to predict the price movement under the assumption that the current trend will continue; calculates a least squares regression line and projects it into the future.
Let’s take a closer look at some of the types of moving averages and the ways they are used in trading.
SMA — Simple Moving Average
To calculate the value of each point on the SMA curve, you need to sum up the closing prices of the last N candles and divide the result by N.
Since market trends can be divided into short-term, mid-term, and long-term, it’s the trader’s chosen strategy that defines the interval N (the number of days) to be used for the MA. In practice, the following ranges are used:
- 5–20 for short-term trends
- 20–50 for mid-term trends
- 50–200 and up for long-term trends
If the current price is above the MA line, then the market is considered bullish in the short-term; conversely, if the price is below the MA, then the market is considered bearish. The MA owes its popularity to its simplicity, but it also has some flaws:
- A lot of false signals (especially during periods of sideways movement)
- Time lags
EMA — Exponential Moving Average
Exponential moving average (EMA) is more sensitive to the most recent data points. Sometimes, it is also referred to as the “exponentially weighted moving average” (WMA). It reacts more significantly to recent price changes and is therefore considered more reliable.
Let’s compare SMA and EMA with the same period of 20:
As you can see, the crossovers of SMA and EMA that serve as indicators to buy or sell a specific asset are close, but sometimes EMA reacts faster to price changes. Additionally, EMA shows divergence less often.
Just like with SMA, traders need to choose a specific period depending on whether their strategy is short term, mid-term, or long term. Experts say that EMA is more applicable for those who trade on intraday and fast-moving markets.
Xena Corrected Average
Xena Exchange has presented its own modification of the MA called the Xena Corrected Average. This indicator uses contrasting colours to highlight the trends and flat sections and is less sensitive to sudden fluctuations that create market noise. The Xena Corrected Average also ignores corrections, distinguishing them from trend reversals.
Making forecasts with moving average
As you might have guessed, there are several criteria traders should track when working with any kind of moving averages, such as moving average crossovers with the chart and moving average convergence and divergence (MACD).
Crossovers are considered the main strategy for moving average users. There are several crossovers that serve as an indicator to buy or sell a specific asset.
Price crossover is when a moving average crosses the price chart. If the price crosses the MA line from below, it is a buy signal. If the price crosses MA from above, it is a sell signal.
MA cross is another approach to trading using two moving averages: one longer one and one shorter one. When the shorter-term MA crosses the longer-term MA from above, a pattern called the “golden cross” occurs, which is a strong buy signal, as it shows the trend is going up.
In the Xena Exchange terminal, you can find an indicator called “MA Cross.” By default, it compares MAs with periods of 9 and 26 and draws crosses right on the charts.
The situation when the shorter-term MA crosses the longer-term MA from below is called the “dead cross” or “death cross” and is a sell signal.
Trading strategies illustrated on Bitcoin moving averages
Before going deeper, let’s compare different period MAs on Bitcoin charts:
- Bitcoin 200 day moving average — long-term strategies
- Bitcoin 50 day moving average — mid-term strategies
- Bitcoin 10 day moving average — short-term strategies
In order to illustrate how MAs can be used, let’s examine a full-fledged trading strategy that uses the MA to determine the trend, a stochastic oscillator to identify periods of correction within the trend, and a MACD histogram that points to short-term reversals.
The strategy uses two MAs with averaging periods of 20 days (short-term) and 150 days (long-term) to identify price-level shifts. The market is bullish when the short-term MA is above the long-term MA and bearish when the short-term MA is below the long-term MA.
The second part of the trading strategy uses a stochastic oscillator to identify corrections. A stochastic oscillator with a range of values from 0–100 is a perfect indicator of short-term retracements and rebounds. Readings under 20 signal that the market conditions are oversold, while readings above 80 point to overbought conditions.
The MACD histogram is used to identify momentum reversals. It measures the difference between the basic MACD and its signal line. The indicator’s value is positive when the MACD is located above the signal line and negative when the MACD passes below the signal line. The MACD histogram is positive when the price is growing and negative when the price is going down.
A “buy” signal is generated when:
- The moving averages show a bullish shift and the short-term SMA passes above the long-term SMA.
- The stochastic oscillator gives a reading below 20, signalling a retracement.
- The MACD histogram moves to positive territory, signalling a rise after the retracement.
A “sell” signal is generated when:
- The moving averages show a bearish shift, with the short-term SMA passing below the long-term SMA.
- The stochastic oscillator gives a reading above 80, signalling a rebound.
- The MACD histogram moves to negative territory, signalling a fall after the rebound.
The strategy described above allows one to trade with the trends. Moreover, it is designed to identify good trading opportunities with an optimal risk–profit ratio. The moving average identifies the trend, be it bullish or bearish. The stochastic oscillator identifies retracements during a bullish trend and rebounds within a bearish trend. The MACD histogram warns of the end of a retracement or a rebound.
All the materials published on this website are provided for informational purposes only. They do not constitute an offer to buy or sell any assets and must not be viewed as trading or investment advice.