We all know the trading clichés: buy low and sell high, take losses quickly and let profits run, fear and greed will ruin your trading, etc. It’s easy to look at a chart and recognize that if you had bought at the low and sold at the high, you would have made a bundle. Hindsight is wonderful. In our never-ending quest to find the perfect trading tool, we sometimes overlook simple ones.
A trend-following system is a viable approach to adhere to all of these principles — buying low, selling high and letting your profits run. The most common tool for trend following is the moving average. It’s where most beginners begin, and it’s where we can start to develop a better understanding of market analysis.
All technical trading is built on statistics, which is essentially nothing more than a combination of probability and arithmetic. An expected value formula can determine if a trading tool is beneficial:
Expected value = (profits on winning trade) * (probability of winning) —
(losses on losing trade) * (probability of losing)
If this results in a positive number, we have a winning system. But just because we have a winning system doesn’t mean it is the system we should be trading. We need to decide if it is a good one to use — and whether a better one can be generated.
A statistic (not to be confused with "statistics") is a number generated from a larger data set that represents that data set. An average is a statistic: data points are combined in some method to form a single piece of data. In a simple average — called the mean — all the data points are added together and their sum is divided by the number of points. This gives an effective equal weight to each point.
In a weighted average, certain points are given greater weight than others, and the sum of those is divided by the weight. An exponential average is merely a form of weighted average. The "moving" part of the name refers to the calculation adding new prices as they occur and dropping the oldest ones as they pass outside the window.
The moving average is a trend-following system that is easy to build and maintain. The simplest use is to buy when price crosses above the moving average and to sell when it crosses below. By definition, you will capture a portion of all trends, but you’ll also miss the beginning and suffer through a number of false positives when no trend ultimately develops.
The sensitivity of the average will depend upon the time period chosen. Short periods will be highly sensitive, long periods less so. A sensitive moving average will capture every move and enter and exit a trend sooner. A long period will have fewer trades, but enter and exit a trend late. But even if our system is a winner, if the probability of a win is low, then the typical trader will have difficulty following it. Many losses will need to be absorbed before the big gain occurs, and it is tough for anyone to stay the course.
By way of example, consider the weekly close of the cash S&P index beginning in January 1970 through Dec. 10, 2010, a data set of 2,137 weeks. The index starts at 92.40 and ends at 1240, a net gain of 1,148 points. For any system to beat a buy and hold strategy, it must earn more than those 1,148 points. As observed in "S&P 500 Data: Three Ways to Profit" (February 2010), the S&P cash index had a high closing price of 1561.80 on Oct. 8, 2007, so our perfect "two-trade" system would buy in January 1970 at 92.40 and sell at 1,561.80. Then we would be short at 1,240. This hypothetically would yield 1,790.80 S&P points, buying at the low and selling at the high. The 1,148 serves as a benchmark and the 1,790.80 as an ideal target. We shall consider any system that produces 65% of our ideal, or 1,164 points of profit, as successful.
We’ll build a 15-week simple moving average and apply a simplistic filter to determine buy/sell points. Recent price action can be seen in "Weekly average" (below). We will go long the S&P when the weekly cash price closes above the moving average for the second consecutive week. We will reverse and short the index when price closes the week below the moving average on the second consecutive week.
Over the 41-year period, our rudimentary system traded 173 times, including its current open trade. It realized 606.94 S&P points, for an average gain of 3.508 points per trade, not including any slippage. The best gain was 503 points, and the worst loss was 181.37 points.
Although this is a winning system because it produces a positive expected value based on the 3,034 points realized on winning trades, it is not a good system. Only 46 of the 173 trades were winners, for a probability of 26.58%. A trader would have to withstand three losses for every four trades; that is enough to frustrate even the most die-hard trader. At that rate, a trader could expect long streaks of losing trades.
The system works well during trending periods, but is subject to numerous whipsaws during times where the S&P essentially is flat. The worst loss string is eight consecutive for a total loss of 613.95 points between Aug. 30, 1999, and Sept. 18, 2000, when the S&P was priced at about 1400. In 1991 and 1992, the system suffered 11 losses in a row, losing 128.34 points when the S&P traded around the 400 level. Ironically, we can conclude from our results that the S&P spent about 30 of the 40 years trading sideways.
Another problem is one of decision error. Because today’s moving average is a function of today’s close, we cannot know the accurate value until the close occurs, which makes it more difficult to execute a correct trade when the close is near the average. Our goals are to see if we can filter out the pesky whipsaw trades because these increase our cost of trading and reduce our probability of winning. As such, they simultaneously reduce the chance of an error trade based on computational issues.
By way of experiment, we’ll displace the moving average by one-half its period. In other words, we will advance it by seven bars. The average generated by this week’s close will become our new data point for seven weeks from now. Today’s point was generated seven weeks ago. This gives us the benefit of knowing what each point will be several weeks in advance and will help mitigate the possibility of taking a trade in error.
Shifting the average also moves the indicator away from the data, which may help avoid whipsaws. The flat periods will generate a flat moving average curve, but we displace it by seven weeks. By further comparison, we can double the displacement forward to 14 weeks. Many data providers have this capability as a standard feature. The results of the two tests are contained in "Shifted results" (below).
Offsetting the data by a half period is not a good solution. While the winning probability increases, the overall results suffer in every other category. The opposite is true of a full period move. By just moving the curve away from the data by its own time frame, we cut the number of trades in half while almost tripling the total gain. Our average trade soars by more than 600%. The best win is preserved, while the worst loss is more than cut in half. The worst string of losses, a total of seven, took place between June 1, 2004 and May 31, 2005, for a loss of 215.56 points when the S&P was priced in the 1,150 range, and the worst total loss was 148 points.
The average winning trade gained 90.04 points, and the average loss was roughly 22 points. We still aren’t winning at least half the time, but we have improved by nearly 50% against the 15-week simple moving average win/loss ratio. Ironically, none of these systems performs better than the one-year indicator described in the earlier article, which would have traded only 13 times in the same period and achieved a profit of roughly 2,236 S&P points with 62% winning trades.
Although neither the 15-week simple moving average nor the seven-week displaced simple moving average achieved our benchmark of 1,148 points, the 14-week displaced the 15-week simple moving average’s profit of 1,717.56 points and nearly generated the ideal 1,790 points from the perfect two trades. Given that no trader is blessed with Cassandra’s ability to foretell the future, we should be quite satisfied with a simple method that could achieve similar results.
Traders could test different moving average lengths and displacements to see if these excellent hypothetical results might be surpassed. It also would be interesting to develop a one-year style system for the short term — for example, compare the current five-minute bar price point to the close one hour ago.
The nicest features about these systems are the ease of the calculations involved and the simplicity of the filter employed. They also are robust, and the concept may be applied to one-minute or one-month bars with equal success. By incorporating a profit target or using a stop against the losing trades, a trader could adapt the methodologies to personal comfort levels and perform the calculations using nothing more than a basic spreadsheet program.
Arthur Field has a Ph.D. from Clemson and is a former fund manager for Fidelity International. He wrote "The Magic 8: The Only 8 Indicators You Need to Make Millions in the Markets," available at www.themagic8.com. Email him at firstname.lastname@example.org.