## The Moving Average (MA)

7 and 21 Exponential Moving Averages

Moving Averages (MAs) are trend indicators that can be used to determine the presence and direction of a trend. They are one of the most versatile tools that can be applied to price charts and are widely used as part of **mechanical trading systems**. A Moving Average (MA) smooths the erratic nature of price action by averaging price data over a specified period. This can be an average of the closing price, the opening price, the high or the low. Thus, a 5-day MA of the closing price is the average of the price close over the last 5 days. As the MA averages past data, they are lagging indicators that follow price movement. Thus, moving averages identify trends only after they have been established. Furthermore, a longer period MA is smoother and less sensitive to price changes than a shorter period MA but has greater lag.

### Types of Moving Averages

There are three popular types of Moving Averages: the **Simple Moving Average (SMA)**; the **Exponential Moving Average (EMA)**, the Smoothed Moving Average (SMMA), and the **Linear Weighted Moving Average (LWMA)**. There are also less popular Moving Averages, such as the **Triangular Moving Average (TMA)**, the **Variable Moving Average (VMA)** and the **Volume Adjusted Moving Average (VAMA)**.

#### The Simple Moving Average (SMA)

The Simple MA is simply the average of the price data for the period under analysis with no extra weighting given to any of the data. Thus, a 5-day MA is calculated simply by calculating the sum of the price for the past 5 days and dividing the result by 5, with the formula being:

SMA_{n} = ( price_{1} + price_{2} + ... + price_{n} ) / *n*

where *n* is the period of the SMA as specified by the trader.

The SMA has two weaknesses which can make it rather erratic. First, the SMA is sensitive to the price that is dropped as the new SMA is calculated. If the price that is dropped is well above average it can cause the SMA to drop appreciably and if the price that is dropped is way below average, it can cause the SMA to increase appreciably. Secondly, the SMA is sensitive to the latest price that is added to the calculation. If the price that is added is well above average it can cause the SMA to increase appreciably and if the price that is added is way below average, it can cause the SMA to decrease appreciably.

#### The Exponential Moving Average (EMA)

The Exponential MA is a refinement of the SMA that attempts to assign more weight to the most recent data, making it less sensitive to the price that is dropped from the calculation, and reduces lag. This is accomplished by applying a smoothing constant to a SMA and then calculating the EMA. Thus, the EMA is calculated in three stage: First, calculate the SMA for the period (*n*); Second, calculate the Smoothing Constant (Sm) using the formula:

Sm = ( 2 / ( *n* + 1 ) )

and finally, calculate the EMA using the formula:

EMA = ( price - previous EMA ) x Sm + previous EMA

#### The Smoothed Moving Average (SMMA)

The Smoothed (MA) is a combination of a SMA and an EMA. It gives the recent prices an equal weighting as the historic prices as it takes all available price data into account. This is achieved by subtracting the previous period’s SMMA from today’s price and adding the result to the previous period’s SMMA to find the current period’s SMMA. The formula for the SMMA starts by calculating the SMA with the same look back period as the SMMA and dividing it by the look back period:

SMMA_{1} = SMA( *n* ) / *n*

where *n* is the look back period for the SMMA. The subsequent SMMA values are calculated using the formula:

SMMA( *i* ) = ( ( SMMA( *i - *1 ) x *n* ) - SMMA( *i - *1 ) + CLOSE( *i* ) ) / *n*

where *n* is the period of the SMMA, SMMA( *i* ) is the SMMA of the current bar, CLOSE( *i* ) is the current closing price.

The SMMA is almost identical to an EMA of twice the look back period. In other words, 20-period SMMA is almost identical to a 40-period EMA.

#### The Linear Weighted Moving Average (LWMA)

The Linear Weighted MA is yet another refinement of the SMA that also attempts to assign more weight to the most recent data. However, it accomplished this by multiplying each price data by its position in the data stream with the oldest price data occupying position 1 and the latest price data occupying position *n* where *n* is the period of the WMA as specified by the trader. The sum of the results is then divided by the summation of *n*. The formula is:

LWMA_{n} = ( ( price_{1} x 1 ) + ( price_{2} x 2 ) + ... + ( price_{n} x *n* ) / ( *n* x ( *n* + 1 ) ) ) / 2

#### Triangular Moving Average (TMA)

The Triangular (MA) is another refinement of the SMA that attempts to improve the indicator's sensitivity to the price action. The TMA attempts to do this by implementing a form of "double smoothing". First a SMA is calculated, then for each subsequent price bar a SMA of the SMA is calculated. This process gives more weight to the middle part of the data interval. The formula used is:

TMA_{n} = ( SMA_{ -1} + SMA_{ -2} + ... + SMA_{ -n} ) / *n*

where *n* is the period of the TMA as specified by the trader.

Unfortunately, double smoothing does not overcome indicator lag and a number of traders prefer displacing the TMA to the left of the chart by half the look back period, and extrapolating the "missing" data to the current bar. However, no form of extrapolation is 100% accurate resulting in the redrawing of the indicator as the data becomes available.

#### The Linear Weighted Moving Average (LWMA)

The Linear Weighted MA is yet another refinement of the SMA that also attempts to assign more weight to the most recent data. However, it accomplished this by multiplying each price data by its position in the data stream with the oldest price data occupying position 1 and the latest price data occupying position *n* where *n* is the period of the WMA as specified by the trader. The sum of the results is then divided by the summation of *n*. The formula is:

LWMA_{n} = ( ( price_{1} x 1 ) + ( price_{2} x 2 ) + ... + ( price_{n} x *n* ) / ( *n* x ( *n* + 1 ) ) ) / 2

#### The Variable Moving Average (VMA)

A variable MA is an adaptation of the EMA that was developed by **Tushar Chande** in 1992. It uses price volatility, as indicated by a 9-period Chande Momentum Oscillator (CMO), to adjust the smoothing constant of the data series. When the volatility is higher, the smoothing constant is higher, which gives the current data more weight. Conversely, when the volatility is lower, the smoothing constant is lower, which gives the current data less weight. This makes the VMA more sensitive during periods of volatility and less sensitive during periods of low volatility, allowing the MA to be more reliable in both high and low volatility markets.

#### The Volume Adjusted Moving Average (VAMA)

The Volume Adjusted MA was developed by **Richard W. Arms Jr.** It assigns weight to the data based on the volume of that period. Thus, the period with the most volume will have the greatest weight in determining the MA, while the period with the lowest volume will have the least weight.

A volume adjusted moving average is calculated by first assigning the weighting to each period using the formula:

( price x volume ) / volume

Then a simple moving average is applied to the results for each period under analysis.

### Trends and Moving Averages

The slope of a Moving Average (MA) defines the direction of the trend. A steeper MA indicates that there is greater momentum behind the trends and, hence, the strength the trend. When the MA starts flattening out it indicates a reduction in momentum. This is the first warning of a possible trend reversal.