The Bull

Wednesday 24

May, 2017 4:50 AM



TheBull PREMIUM

  • Trading
  • &
  • Technical
  • Analysis

Developing a trend-following system

Developing a trend-following system

By Sandrina Riddell 19.10.2015


I became more interested in moving averages when I was looking into developing a trend-following system, since moving averages help identify trend reversals. Therefore, I took a closer look at the differences between the different types of moving averages and the possible benefits of using one versus another.

For those of you new to trading, trend-following strategies target larger price movements in one direction, as the name implies. For example, a good trend-following trade would have been shorting a major stock index in October 2008 and exiting the trade sometime early 2009. Usually trend-following strategies imply keeping a trade open overnight. The length of the trade could vary from a couple of days to a few months because trends can vary in length. Trends are readily divided into three categories: primary trends (between 9 months and 2 years), intermediate (between 6 weeks and 9 months) and short term (typically from 2 to 4 weeks). I will show you how I was able to “capture” one of the shortest trends.

As I was playing around with different moving averages, I started paying more attention to how they respond to price changes, basically to their sensitivity to such changes and also reliability of trading signals. The idea was to buy the stock if the short term moving average crossed above the longer term moving average, such as a 10-day simple moving average (SMA) cross above a 20-day SMA. A sell signal meant that the 10-day SMA crossed below a 20-day SMA. I asked myself if I should use a cross of simple moving averages or a different combination, such as a SMA with a weighted moving average (WMA) or an exponential moving average (EMA).  My objective was to develop a system that alerted me quickly enough about the beginning of a trend, but still eliminated the false signals associated with “whipsaws” or “non-trendy price movements.”

WMA and EMA: Similarities and Differences

First of all, let’s start with similarities: they are both weighted moving averages, unlike the simple moving average, which treats all data indiscriminately. A simple moving average is constructed by summing the closing values and dividing the sum by the number of periods. Closing prices are used in the calculation of moving averages because they are considered more reliable than openings, heights or lows, since they reveal the price at which traders are willing to carry a position overnight. The SMA is the most reliable of the moving averages and  some of the advantages of using simple moving average crosses is to pinpoint potential trend changes and receive objective entry and exit trading signals.  However, one of the disadvantages of simple moving averages is the fact that the signal could be delayed, since the SMA distributes the same weight to all periods, no matter how old they are, and therefore it may not react timely enough to directional changes.

One method that attempts to overcome the weakness of SMA is to weight the data in favour of more recent observations.  The weighted moving average tries to solve this shortcoming. The most common technique used to built weighted moving average is to multiply the first period by 1, the second period by 2, the third period by 3, and so on.  The next step is to sum the calculations. The third step is to sum the weights and finally, the last step is to divide the second step by the third’s step value. As a result, WMA is more sensitive to price changes than SMA.

During times when most trading days have similar trading ranges (the absolute value between the opening less the closing price), the weighted and simple moving average work just fine. However, if the last 20 days have a significantly different range than the day preceding them, omitting that 21st day from calculations does not paint an accurate picture, therefore making the practice of dumping older data detrimental. This is why both WMA and SMA have a common weakness: they do not take into consideration the oldest data. The exponential moving average (EMA) addresses this issue as well as weighting the data issue, making the EMA a hybrid between SMA and WMA.

Calculating EMA by hand is somewhat cumbersome, but luckily the trading software does it for you; you only need to specify the length of the period: 10, 18, 25, etc. FGL’s chart below shows how the 20-day EMA (the blue line) tracks the price changes closer than the stock’s 20-day SMA.

Image

It is worth knowing the logic behind moving averages since they are also used as foundations for other indicators and oscillators, such as McClellan Index and MACD (moving average convergence divergence) or Bollinger Bands.

Going back to my trend-following system, I noticed that a combination of a 10-day SMA and a 20-day EMA provided reasonable buy and sell trading signals (please see chart below).

Image

Other Considerations for Moving Averages

When plotting an MA on a chart you can notice that a security’s price from time to time crosses the MA, either above or below. It is important to observe (please see chart below) that not all crossovers are valid, meaning that not all of them signal a trend change. This is why allowing some room for error may be a good idea. In practice this can be accomplished by waiting till the closing of the trading session before making any decisions and observing if the crossing still holds. Another filtering technique is to create a range around the moving average. For example, if a stock varies from its MA at the closing of the day by 1%, then the crossover is considered valid. Another filter could be that the crossover has to be in place for more than one trading session before reacting on this information. Lastly, a combination of all of those three filters can be used to separate wheat from the chaff, metaphorically speaking. However, it is noteworthy to mention that a reversal in the direction of the MA is more reliable than a crossover. Also, a crossover of a 10-month average is more significant than a crossover of a 25-day average. Unfortunately, given their lagging nature, moving averages tend to reverse after the old trend stopped. The chart below illustrates how moving averages crossovers work and sometimes do not work, please see the last buy and sell signals.

Image

We established why closing data is the data of preference when constructing moving averages, but the question remains: how much data should you use? Whatever time span is used is significant, since a moving average that is too short is not going to filter out the whipsaws or the noise, and a moving average that is too long does not provide enough trading signals. Both extremes are pointless for trading purposes. In general, the length of the moving average depends on the type of trend and the stock’s characteristics; nevertheless, neither of the moving averages are bullet proof. Normally, for shorter-term trends, 10, 25, 30 and 50-day spans are advised, but for longer time spans, 40-week SMAs and 65-week EMA averages are advocated. When using monthly data, 6, 9, 12, 18 and 24-month moving averages are more reliable. Martin J Pring, renowned technical analyst and author observed, “There is no such thing as a perfect average. The choice of time span always represents a trade-off between timeliness (catching the trend at an early stage) and sensitivity (catching a trend turn too early and causing an excessive number of whipsaws)."

Although not as popular and easy to understand as SMAs, EMAs and WMAs are capable of compensating for the SMA’s shortcomings and providing a good foundation for the popular Bollinger Bands and MACD.

>> BACK TO THE NEWSLETTER: Click here to read other articles from this week's newsletter

 



FROM THE NEWSLETTER

The online media duopoly

The market dominance of the two US tech giants... More

Fixed interest outlook

Our outlook remains cautious across several... More

Australian households have never been wealthier

High level aggregate data suggest household... More

Investor Signposts: Week Beginning May 22 2017

If it wasn?t for the Reserve Bank, the upcoming... More



WHAT’S ON THIS WEEK

week 26 May 2017
    • 22
    • CoreLogic Capital city house prices for the week just ended | 9:30 AM
    • 23
    • RBA Deputy Governor Guy Debelle speaks at BIS Symposium | 9:30 AM
    • 24
    • ABS Construction work done for the March quarter | 9:30 AM
    • 25
    • RBA Deputy Governor Guy Debelle speaks at FX Week | 9:30 AM
    • 26
    • ARB Australian Retail Banking Summit | 9:30 AM

TheBull.com.au

TheBull.com.au

TheBull PREMIUM article search



Markets
Index: Points Change Percent

Featured Comment

The US Freelancers Union estimates that just over one in three workers in that country is an independent worker.

Channelling the upsurge in independent workers

Broker buys

  • ASX Code
  • Company
  • Broker
  • SEASundance EnergyMorgans
  • ASHAshley Services GroupMorgans
  • DDRDicker DataWise-owl.com
  • GAPGale PacificWise-owl.com
  • AYSAmaysimKOSEC
  • ALUAltiumKOSEC

Broker sells

  • ASX Code
  • Company
  • Broker
  • DMPDomino`s PizzaMorgans
  • MTOMotorCycle HoldingsMorgans
  • MWRMGM WirelessWise-owl.com
  • HFRHighfield ResourcesWise-owl.com
  • MYRMyerKOSEC
  • EPWERM PowerKOSEC

Central Banks Rates

  • RBA1.50%
  • FED0.50%
  • BOE0.25%
  • BOC0.50%
  • RBNZ2.00%
  • ECB0.00%
  • SNB-0.75%
  • BOJ-0.10%

Upcoming dividends

  • ASX Code
  • Company, Div., Franking
  • Ex-Div.

Eight brokers like these stocks

  • ASX Code
  • Company Name
  • Consensus Target

Upcoming Floats

  • ASX Code
  • Company Name
  • Float Date

PLEASE SUPPORT OUR SPONSORS, AUSTRALIA'S LEADING BROKERS:



© Copyright The Compare Group Pty Ltd. All rights reserved.