Training Zone Banner

 Tutorial 22 - Understanding Moving Averages

A moving average calculates the average price of a share over a given period of time and can be helpful in identifying the general trend of a stock by smoothing out price fluctuations.

There are a number of ways to interpret a moving average but generally prices above the moving average indicate a bullish trend and prices below the moving average indicate a bearish trend.

ShareScope allows you to add a number of different moving average types and set accompanying options and we will look at each option in turn.


 Moving Average Dialog

Moving averages can be added to the graph screen via the Moving Average dialog.

To access this option, right-click in the middle of the screen and select Moving Averages... from the context menu.

This displays the following dialog:

Here you can set up to 4 simple moving averages, customise the MA period and colour and add Bollinger Bands to your graph. Additional options can be found by clicking on the Advanced >> button.

In ShareScope Gold, the Advanced settings (below) allow you to edit the type and appearance of the moving average (simple, exponential, weighted, triangular or variable) and also specify the number of periods that the MA is calculated over. You can also add or edit Bollinger Bands, Envelopes and set various lagging options (see later).

In ShareScope Plus/Pro, clicking on the Advanced >> button displays a different dialog:

In addition to the 4 moving averages available in the Standard MA dialog, you can add up to 4 further lines, giving you a possible 8 in total.

A greater range of customisable options for each setting is available by clicking on the corresponding button - for example 10 SMA, Lagged.



Note: ShareScope Plus/Pro users can access two additional moving averages - the Variable CMO and VIDYA. Ribbons may also be added along with 4 additional channel types: Envelopes, Bollinger Bands, STARC and Keltner.


 Types of Moving Average

As mentioned there are a number of ways of calculating a moving average – we will look at each of these in turn:

ShareScope Gold ShareScope Plus/Pro


 Simple Moving Average (SMA)

A simple moving average is the most basic calculation of the moving average. It is calculated using the arithmetic mean – in other words by summing the price of the stock over a set number of time periods, and dividing this total by the number of time periods.

For example, to calculate a basic 10-day moving average you would add up the closing prices from the past 10 days and then divide the result by 10.


 Exponential Moving Average (EMA)

The exponential moving average gives more weight to recent prices in an attempt to make it more responsive to new information.

The calculation method used by exponential averages is cumulative, meaning that all previous bars have some effect on the EMA value, although that effect diminishes greatly with time.  It is similar to other moving averages however in that the smaller the period, the more responsive the MA will be, as the most recent bar will have a greater effect.

The EMA is calculated by applying a percentage of today’s closing price to a percentage of yesterdays moving average values. The percentage is calculated from the time period selected.

For example, a 10 day exponential moving average is first calculated by converting the time periods to a percentage:

% = 2 / (time periods + 1)

  = 2 / (10+1)

  = 0.18

Then this percentage is used to calculate today’s EMA value using the latest close price and yesterday’s EMA value:

(Today’s close * 0.18) + (Yesterday's EMA * 0.82)



 Weighted Moving Average (WMA)

The weighted moving average also uses values calculated to give more weight to more recent dates.

The weighted moving average is calculated by multiplying each of the previous day's data by a weight factor. That factor is based upon the number of days past the first day used in the Moving Average, for example a 4 day WMA gives four times more weight to today's price than to a price four days ago.

Day
(higher number = more recent)
Weighting Closing Price (pence) Weighted Value
1 1 14 14
2 2 16 32
3 3 17 51
4 4 14 56

The total of the weighted values is then divided by the total weighting to give the average weighted value for each day.

Using the figures above for a 4 day weighted moving average, the most recent value is calculated as follows:

Today’s WMA = Total weighted value / Total weighting

= (14 + 32 + 51 + 56) / (1 + 2 + 3 + 4)
= 15.3



 Triangular Moving Average (TMA)

A triangular moving average is similar to exponential and weighted moving averages except a different weighting scheme is used. In this case, more weight is placed in the middle portion of the share price and in effect it is a moving average of a moving average.

To illustrate this in practice, a 12-period triangular moving average would be calculated as follows:
  1. Add 1 to the number of periods in the moving average (e.g. 12 plus 1 is 13).
  2. Divide the sum from Step #1 by 2 (e.g. 13 divided by 2 is 6.5).
  3. If the result of Step #2 contains a fractional portion, round the result up to the nearest integer (e.g. round 6.5 up to 7).
  4. Using the value from Step #3 (i.e. 7), calculate a simple moving average of the closing prices (i.e. a 7-period simple moving average).
  5. Again using the value from Step #3 (i.e. 7) calculate a simple moving average of the moving average calculated in Step #4 (i.e. a moving average of a moving average).

As the triangular moving average smoothes a data series, it is best applied in volatile market conditions in order to help to identify significant trends more easily.


 Variable (VHF) Moving Average

A variable moving average (V/VHF) is a form of exponential moving average that adjusts the smoothing percentage according to the Volatility. The more volatile the share's prices, the more weight is given to recent data. This is sometimes known as variable VHF.

It is calculated as follows:

Today's V/VHF value = ((EP * VR) * Close) + ((1 - (EP * VR)) * Yesterday's MA

where:

EP is the Exponential Percentage - 2 / (time period + 1)


VR is the Volatility Ratio (9-period Vertical Horizontal Filter (VHF)/ 12 periods’ ago 9-period VHF)

The Variable Moving Average solves a problem with most moving averages. In times of low volatility, such as when the price is trending, the moving average time period should be shorter to be sensitive to the inevitable break in the trend. Whereas, in more volatile non-trending times, the moving average time period should be longer to filter out the choppiness.


 Variable CMO Moving Average (Plus/Pro only)

Variable CMO (V/CMO) is a form of variable moving average based on the Chande Momentum Oscillator.

It is calculated as follows:

Today's V/CMO value = ((EP * VR) * Close) + ((1 - (EP * VR)) * Yesterday's MA

where:

EP is the Exponential Percentage = 2 / (time period + 1)
VR is the Volatility Ratio = 9-day Chande Momentum Oscillator / 100

As the Chande Momentum Oscillator is a measure of volatility, the benefits of using the Variable CMO are similar to those of the Variable VHF above.



 VIDYA (Plus/Pro only)

The Variable-Index Dynamic Average (VIDYA) is simply a variable-length exponential moving average based on price momentum or volatility.

In a relatively flat trading environment, the effective time period is much longer, making the moving average flatter. This flatness is a useful signal of price consolidation which is not possible with an ordinary exponential moving average.

When market volatility increases, the effective length of the moving average shortens and the VIDYA moves close to the minimum period moving average set for the VIDYA.

The actual calculation of the moving average time period is based on the standard deviation of the closing price over 20 ShareScope periods (e.g. 20 days). If you choose, for example, a 9-period VIDYA, then the actual moving average period varies from 9 ShareScope periods (in volatile conditions) upwards.

For more information on VIDYA, see Chande’s Beyond Technical Analysis (2nd Edition). (link to Global Investor)



 Advanced Options

ShareScope Gold ShareScope Plus/Pro

 Bollinger Bands

Bollinger Bands are bands plotted at a given number of standard deviations above and below a moving average. As standard deviation is a measure of volatility, the more volatile the share price, the wider the band – and the less volatile the share price, the narrower the band.

The underlying concept is that overzealous buyers and sellers will drive prices toward the upper or lower band. When the security reaches the upper band, this is taken as an indication to sell - when the security reaches the lower band, to buy.

By default, ShareScope uses 2 standard deviations, but you can change this via the Advaced >> options.



 Envelopes (Trading Bands)

Envelopes are similar to Bollinger Bands in that they consist of two bands plotted above and below a moving average. Envelopes however differ in calculation: a moving average is shifted above and below by a fixed percentage – for example 10%.

The required shift is determined by the volatility of the security. Volatile securities will require a greater percentage shift, less volatile securities a smaller percentage shift.

The interpretation of envelopes is similar to that of Bollinger Bands.


 Ribbons (Plus/Pro only)

Ribbons involve the charting of several moving averages on top of the price graph.

This can be used to help judge the strength of the current trend. When all moving averages are moving in the same direction, the trend is said to be strong. Reversals are confirmed when the averages cross over and head in the opposite direction.

You can select your own ribbon periods or use one of the preset ribbon types to apply ribbons using numbers from a particular mathematical sequence – Fibonacci, linear and geometric – or Daryl Guppy or Alan Farley settings.

To change the setting used, click on the Select preset values button.

The image below displays a 10-period moving average with 8 ribbons in linear sequence (20, 30, 40, 50, 60, 70, 80 and 90 periods):

 STARC (Plus/Pro only)

Stoller Average Range Channels, or STARC bands, create a channel around a 6-period simple moving average.

Unlike other bands, STARC bands are not based on closing prices but on the Average True Range of the share price. This provides a more in-depth view of market volatility and helps to define the upper and lower limits of normal price movement: the channel narrows in a steady market and broadens in a volatile market.

STARC bands are sometimes used to assess the level of risk involved in trading a security. They show the likely limits of price movement in the short-term future, and can therefore assist traders in the placement of stop losses or similar instruments.

Like Bollinger Bands, STARC Bands will tighten in steady or low volatility markets and widen as volatility increases. The difference lies in that rather than being based on closes, STARC Bands are based on the Average True Range. This gives a more in depth picture of the market volatility. While the penetration of a Bollinger Band may indicate a continuation of a price move, STARC Bands define the upper and lower limits for normal price action.

The Average True Range is calculated by taking the highest value of the difference between the following prices:

High (today) and Low (today)

Close (yesterday) and High (today)

Close (yesterday) and Low (today)

The image below displays a 6-period simple moving average with 15-period STARC bands:

 Keltner channels (Plus/Pro only)

Keltner Channels are simply moving-average bands – with a middle line and two outer lines.

A central 10-period moving average based on the typical price (the average of the high, low and close) is channelled with a band on either side.

It is generally interpreted that a trading opportunity is signalled if the price passes past either the higher or lower band. If the price rises above the upper band, it is a sell signal and if it falls below the lower band, it is a buy signal.

A 10-period simple moving average with 10 period Keltner bands is displayed below:


 Lagging Options

Moving averages smooth out a data series and make it easier to identify the direction of the trend. Because past price data is used to form moving averages, they are considered lagging, or trend following, indicators.

The shape of a moving average (MA) should be roughly the same as the shape of the price data, but the peaks and troughs will be later in time (which is called lag). The lag will always be a fixed amount, depending on the MA. For simple MA, the lag is always half the period of the MA, but for other types of MA, the lag may be a different amount.

This lag can be removed through two methods.

  1. The first method, termed unlagged simply shifts the moving average line left by half the MA period, so that it sits in line with the price.

    For example, an unlagged 20 day simple moving average will shift 10 days to the left.

  2. Centred calculates the actual lag on a sample triangle wave and shifts the moving average to the left by this resulting value.

In addition, the type of lag can be adjusted through a manual shift using the up/down arrows next to the lag selection. This option moves the moving average line any number of price data periods to the right (positive number) or the left (a negative number).

Lagged - no shift Unlagged - no shift Centered - no shift Lagged - shift 10 periods

Remember, if you have any trouble finding or using any of these features, please don’t hesitate to call our Customer Support team. They will be delighted to help.

From outside London: 0845 045 0111
From London: 020 7749 8504
Email: support@sharescope.co.uk