One is to take a position ina broad-based index and wait to see if the movement starts. If it does, youwill have bought near the lows. Your second possible action is to wait forprices to actually start rising and for some event to confirm the trend;then you would buy into the broad-based index, expecting that thetrend—already confirmed—would continue. Some analysts call this the“trend is now your friend” approach.Either way works, as it happens, and I use one or the other, depending on how I feel about the market and other factors. The choice depends on how close to a pivotal point you are and how reliable you feelthat pivotal point is (explained in an earlier chapter).Interestingly, even if you use the first method, you will still needthe second category of indicators eventually. Let me explain. Suppose
168
TRADING RANGE INVESTMENT STATEGIES
the predictive indicators are saying the market is ready for a good longadvance. You purchase a broad-based index based on this expectation,and the move begins. The predictive indicators, however, do not alwaystell you what sectors of the market will be the best performers during theup move. This is especially true as the move matures. As the move progresses, it is noted that a certain class of stocks is far outperforminganother class. This type of information comes from the second, trendconfirming class of indicators. In practice, you take an initial position ina broad-based index using the predictive indicators, but as the moveunfolds you adjust the investment using trend-type indicators to findbetter-performing broad-based sectors.The studies I did for this book used indicators from the second category—indicators that define market price trends. I chose them becausethey are much easier to back-test than predictive indicators. Trendconfirming indicators are usually very exact and mathematical, so it iseasy to define exact points where the trend is either up or down.The simplest example of a confirming-type indicator is when pricesbreak through a trendline. But how and where to draw a trendline to doa study is very subjective. We get around that by using another technicaltool, the moving average, to establish an objective way of drawing trendlines. From this point forward, the studies in this chapter all use movingaverages in one way or another.Market Timing Using Moving AveragesMoving-average trend indicators are part of the second approach to market timing—they provide a mathematical technique useful in definingmarket trends. To create a moving average, you add up the price of anindex for a specific number of days and divide the sum by the number ofdays. We call the result a moving average because it moves in time andchanges with the addition of each new day. A moving average is like a timewindow that shows you the latest average price over the time specified.Here is an example. To create a moving average, consider any timeperiod—for example, 23 days—and then calculate the average price of astock or market index over that period. The average price moves, orchanges, a little every day because the time period (in this example, thelast 23 days) is always changing. You have to recalculate the averageevery day. Figure 8.2 shows a 23-day moving average of the S&P 500over the 18-month period between 1/31/97 and 7/31/98.
TWO APPROACHES TO MARKET TIMING
169
FIGURE 8.2 Example of a moving average. Notice how the moving average(dotted line) smoothes out price fluctuations and lags behind the most recentprice.1,200
1,100
S&P 500
1,000900
800
7001/31/97
7/31/97
1/31/98
7/31/98
TimeS&P 500
23-day Moving Average
A moving average has the effect of smoothing out the price fluctuations that occur within the time frame of the average. In our example ofa 23-day moving average, a sharp movement over 2 days will be softenedbecause you’re averaging those 2 days against the other 21 days. Similarly, if you had a 200-day moving average, a sharp movement that occurred over 2 or 3 weeks would be blended away by all the other days inthe average. Moving averages act as filters; they help filter out the pricemovements that occur over shorter periods within the overall periodbeing measured.After you calculate a moving average, there are a number of ways touse it to define market trends. The method that many technicians useand the one I used in these studies is shown in the sidebar. Longer-termmoving averages are sensitive to long-term price trends, and shorterterm moving averages react to and show short-term price trends.
170
TRADING RANGE INVESTMENT STATEGIES
Defining Trends Using Moving AveragesThe moving average is used as a cutoff to define a trend. If the lastprice of an index raises its average price for that index, the trend forprices is considered up. Similarly, the trend of prices is considereddown when the current price is below the moving average.
AMFLY
Moving averages always measure where prices have already been,lagging behind the most recent changes in price, which is exactly whatwe want. Remember that a moving average won’t help you predict—it isa mathematical measure to establish a running cutoff number to definesomething. In an advancing market, the most recent prices will eventually cross over and be above the moving average, constantly signaling thatthe trend is up, whereas in a declining market, prices will cross over andbe below the moving average, signaling that the trend is down.All of which leaves one very important question unanswered: If we’regoing to use a moving average to define the market trend, what time period should the moving average measure?
TE
MY FIRST MOVING-AVERAGE STUDY
Through the years, I have watched as various market advisors used different moving averages in their work. Some used a 200-day average todetect long-term trends. Others used a 39-week (195-day) average. Someused a 100-day average to find intermediate-term trends, and othersused 10-, 25-, 50-, or 75-day averages. Nowhere did I see an explanationof why they chose these time periods. It seemed suspicious that they always used numbers that ended in 10s or 5s (e.g., 10, 20, 25, 50, 100, 195,or 200). Why not 73 days, for example? Where was a study that showedwhich moving averages worked best at finding the different markettrends? I saw small studies, but none that I thought was convincing.To answer this question I set out in 1983 to backtest every movingaverage from 5-day to 200-day averages. My goal was to find which moving averages produced the best return over a long period. I also had another motive: I realized that the moving-average study might also allowme to test the long-held belief that the stock market might be followingcertain natural time cycles.
MY FIRST MOVING-AVERAGE STUDY
171
Time Cycles in the MarketFor many years people have believed that the stock market might operate according to certain repetitious time cycles. For example, in the11950s, 1960s, and 1970s, there was widespread belief and talk of the 4 ⁄3year business and investment cycle. Major market bottoms often oc11curred about 4 ⁄3 years apart. Figure 8.3 illustrates the popular 4 ⁄3 -year1market cycle, and I think it is obvious from it why belief in the 4 ⁄3-yearcycle became widely accepted.Repetitious time cycles of other frequencies also seemed to occur,and analysts made some effort to identify them, too. One of the originalworks on the subject was The Profit Magic of Stock Transaction Timing,by J.M. Hurst. He used a type of mathematics developed by the Frenchmathematician Fourier. Fourier’s method shows how any curve canbe broken down into the sum of a long series of cycle waves of specificfrequencies.I never found that this approach worked well or produced a resultthat was particularly useful. I decided to approach the question from another angle, using a concept from physics called resonance. I thought of
1
FIGURE 8.3 Analysts have often talked about a 4 ⁄3-year business and stockmarket cycle. The evidence for it is readily seen in this chart.160
S&P 500
120
80
40
01950
1954
1958
1960
1966
1970
1950–1980
1974
1978
172
TRADING RANGE INVESTMENT STATEGIES
a way that moving averages might be able to locate natural cycles in themarket, if they existed.Using Resonance to Find the Time Cycles in the MarketSome physicists have speculated that resonance may have caused thewalls of Jericho to fall. If an object has a natural frequency of vibration,when you push it back and forth with some force at that same frequency,you get a very large effect—that is resonance. With resonance, the objectvibrates to an extent way out of proportion to the cause of the vibration.The frequency of the force must be close to the natural frequency of theobject; if the force vibrates at other frequencies, you get a much smallereffect. In the story of Jericho, presumably, the sound frequency of theenemy’s trumpets matched the natural frequency of the walls, causingthem to vibrate wildly and fall apart.Another example of resonance is found in a tuning fork, which has aspecific vibration frequency. Strike it and you hear a tone. If you playmusic near a tuning fork, the tuning fork vibrates not only at its naturalfrequency, but also at the different frequencies of the music. However,by far the biggest vibration in the fork results when the frequency of themusic is exactly equal to the tuning fork’s natural frequency. Other frequencies make it vibrate, but much less so.Figure 8.4 shows the standard mathematical curve that indicateswhen resonance is occurring. The graph displays how much a tuningfork, for example, vibrates when you apply different frequencies of music(or notes) to it. The largest movement of the tuning fork occurs when thefrequency of the sound striking the fork equals its natural frequency.This basic pattern will be important when we get to the results of thestudies.If the stock market has certain natural frequencies, how do you forcethe market to vibrate at different frequencies, to test for resonance asyou would with a tuning fork? You can’t really do that, but you can dosomething very similar. You can take the price curve of the S&P 500 for
Resonance is an unusually large vibration of a system produced inresponse to an external stimulus of the same frequency (or nearly thesame) as the system’s natural vibration frequency.
MY FIRST MOVING-AVERAGE STUDY
173
Measurable Effect
FIGURE 8.4 A system that has resonance produces this type of curve. Thenatural frequency of the system is at the peak of the curve.
ResonanceFrequency
Frequencies
the last 70 years and see what happens when you apply different movingaverages to determine which one produced the greatest profit. Tryingevery moving average is like trying to force the market to respond to different time frequencies. If there are natural frequencies to the market,moving averages close to those frequencies would probably be in better“harmony” with the market’s price movements than moving averages ofdifferent time spans. The right moving average would catch any naturalprice movements closer to the bottom and closer to the top than othermoving averages.The Original Moving-Average StudyThe purpose of the first study of moving averages was to answer twoquestions:1. Which moving average was the best at confirming a markettrend?2. Do stock prices manifest the phenomenon known as resonance?I did my original study in 1983, repeating it in 1992 and again in1999. The results haven’t changed since the first study.
174
TRADING RANGE INVESTMENT STATEGIES
What has changed is the availability of data and the ease of computing. I did the first study in 1983 right after I purchased one of the original IBM PCs. To do it, I needed the daily closing price of the S&P 500from the earliest data available, plus the monthly dividend and T-billrates. At that time none of this information was available on floppy discs,so I had to input all the data by hand. I got the daily data from Standard& Poor back to 1928 and it took me two weeks just to enter the data.Then I had to learn basic programming to write the routines to do thecalculations. The machine was so slow that calculating all the moving averages took a full day. Spreadsheets applications were primitive and fartoo slow to be useful. Now, all that has changed and the data are mucheasier to obtain.How was the study done? I set the start date at January 1, 1929, andassumed that there were 196 accounts with $1 in each. The first accountreflected the result of using the 5-day moving average on the S&P 500each day for 70 years. The second showed the result of using the 6day moving average on the S&P 500 each day for 70 years, and so forth.The 196th account reflected the result of using the 200-day movingaverage.When a moving average was positive, meaning that the closing priceof the S&P 500 was above the moving average, that account was assumedto be invested in the S&P 500 (the trend was up). Any dividends declaredwhile invested would be included and compounded. When the S&P 500closed below the moving average, the computer sold the S&P 500 inthat account and the funds went into a T-bill account to gather daily interest. As long as the price stayed below the moving average, the accountstayed invested in the T-bill. When the closing price of the S&P 500again moved above the corresponding moving average, the computermoved the account back into the S&P 500. I monitored each of the 196accounts daily, watching how the initial $1 grew over 70 years.The ResultsBefore we study how well this mechanical way of using moving averagesperformed, we must first establish what the S&P 500 would have produced without any changes, if one had stayed fully invested. During the70 years under study, buying and holding the S&P 500, with dividendsreinvested, produced an average return of 10.3% per year. This basic return is the benchmark against which to compare the performance of the
MY FIRST MOVING-AVERAGE STUDY
175
various moving averages. The benchmark return of 10.3% is representedby the horizontal dotted line in Figure 8.5.On the same chart, I’ve plotted the average yearly gain of eachmoving-average account produced in 70 years. For example, over 70years, the 5-day moving average produced an average return of 8.8% peryear, the 6-day a return of 8.5%, the 7-day a return of 8.2%, and so forth.I’ve plotted each of these results from 5 to 200 days and the other line inthe figure represents the plotting of these moving-average returns. The5-day is on the far left and the 200-day on the far right.This chart shows that using shorter-term moving averages producesa lower return than simply buying and holding the S&P 500 average. Butlonger-term moving averages seem to do better than buy-and-hold—asmuch as 2% better. The basic pattern was what I had hoped. Althoughthe highest point was at the 134-day moving average, resonance appears
FIGURE 8.5 Moving-average timing versus S&P 500 buy and hold. This chartshows the back-tested result of using different moving-average timing methodson the S&P 500 over 70 years (1929 to 1998). The study assumes the freeexchange privilege and that the exchange was done the day after a signal wasgiven. The results shown are those of a variation on the normal moving averagein which each moving average was shifted downward by 1.5%.
Average Annual Gain over 70 years
14%S&P 500Buy and Hold12%
10%Resonance Peak?8%
6%
20
40
50
80
100
120
Moving Averages
140
160
180
200
176
TRADING RANGE INVESTMENT STATEGIES
Original Study RestrictionsWhen I first did this study in 1983, I imposed certain restrictions toconform to the investment vehicles available at the time. I did this sothat if one wanted to apply the results of the study, it would be possible. In 1983, it was possible to invest in the S&P 500 only through anindex mutual fund. The spiders and exchange traded funds (ETFs) oftoday were not available. One disadvantage of this method is thatwhen you buy or sell, you are limited to getting the closing price at theend of the day. Even if you decide to sell a mutual fund in the morning, you still get the price of the S&P 500 at the close of that day.Therefore, I put this restriction in the study: The price you buy orsell at is always the next day’s price after a signal is given. This is necessary because you have to wait until the market closes to do thenew moving-average calculation. If a signal is given, your trade can’tbe executed until the next day, at which time the next day’s closingprice will apply.One advantage of a mutual fund is that you can use the freeexchange privilege it provides. The free exchange allows an investorto move from the stock fund into a money market fund and backagain without paying a commission. You also avoid paying thespread, which is the difference between the bid and the asking price.Some funds put restrictions on the number of times you can makesuch a transfer, but with the longer-term moving averages, the number of exchanges is minimized, so this would not be a problem.It is very difficult to calculate the effects of taxes on a timing strategy. Nevertheless, it is an important consideration and one thatshould be carefully analyzed. Even if a timing strategy did better thana buy-and-hold strategy, the opposite might be true if taxes were factored in. Therefore, in my opinion it is best to implement this type ofstrategy in a tax-deferred account, such as a tax-deferred annuity, atax-free (Roth) IRA, or a deferred retirement account or regular IRA.The graph in Figure 8.5 shows the 70-year results of a slight variation of the simple moving averages. Besides testing every movingaverage, I also tested many variations of these moving averages,such as what would happen to the results if I shifted every movingaverage up or down a little. I tried many different shifts for every
MY FIRST MOVING-AVERAGE STUDY
177
average, which gave me the ability to fine-tune each one, much likegoing back and forth on a radio dial helps find the exact point of bestreception.Figure 8.5 reflects this fine-tuning. I obtained the best results byshifting all the moving averages downward by 1.5%. In other words,the decision to move in or out of the S&P 500 was whether the S&P500 was higher or lower than 98.5% of the moving average. Thisfine-tuning helped push the peak point to its maximum.
to peak at the 130-day moving average, which produced an average return of 12.5%, about 2% better than the average S&P 500 buy-and-holdresult over the 70-year period examined.The 130-Day Moving AverageAfter calculating and plotting the 70-year results, I looked very carefullyat the high point: the 130-day moving average. Although it wasn’t themoving average that produced the absolute highest return (that was the134-day moving average), it was the center point of the curve if Ismoothed it out and rounded it over. Using the 130-day moving average,I plotted the day-to-day result that led to a 12.5% average annual returnand compared it to the daily buy and hold result of the S&P 500. Figure8.6 shows the daily growth of $1 using this adjusted 130-day moving average plotted against the growth of $1 in the S&P 500.The original study covered a long period and many types of markets.A number of people have questioned whether it is actually a worthwhilemeasure since the structure of the market has changed over time, as hasthe economy. This is true, but the human factor in trading probably overrides or mitigates the effects of these structural changes. Any market reaction to emotional trading that would produce certain repetitiouscyclical movements would still stand out over such a long period. Inother words, if a cycle existed for only a short period, the long period ofthe study would have washed it out and not have highlighted any particular moving average.
178
TRADING RANGE INVESTMENT STATEGIES
FIGURE 8.6 Best moving-average result versus S&P 500. I chose the 130-daymoving average (downshifted 1.5%) and calculated the resulting daily value over70 years. This graph compares that daily value to the daily value of buying andholding the S&P 500.
Result of $1 Invested
$10,000Account using 130 daymoving average(Negative Offset) – 12%
$1,000$100$10
Result of S&P 500(Buy and Hold) – 10.3%
$1$01929
1940
1951
1962
1973
1984
1995
1929–1998
Since the 70 years included the Great Depression, two long (18year) bull markets, and a 16-year trading range, this study presents atiming method that seems to work well over a long period and throughmarkets of all types. Some might consider using the 130-day moving average a panacea: The theoretical results are better than buy and hold andit allows one to avoid major bear markets. However, it’s not a panacea.One major problem with using any moving average to determine thetrend is the phenomenon known as the whipsaw.Factoring in the WhipsawFor all their uses, moving averages present potentially frustrating andcostly drawbacks. The whipsaw is the major one. A whipsaw occurs whenthe price rises above the moving average, signaling a buy into the market,and then reverses, causing an exchange backout, during which you oftenend up selling at a lower price than you just paid. It is important to un-
MY FIRST MOVING-AVERAGE STUDY
179
A whipsaw is a quick reversal in a moving-average signal. When theprice gets close to the moving average, it can at times move aboveand below the moving average many times before it firmly establishes a trend. These movements produce a false confirmation of thetrend and a false signal to buy or sell. Whipsaws cause you to buyhigh and sell low most of the time, and normally two out of threesignals using moving averages produce a negative return. Whipsawscan be very extreme in volatile markets and can erode gains. As faras I know, there is no way to avoid them.
derstand that when using moving averages, approximately two-thirds ofall exchanges end with a negative result, and it is probably unavoidable.Yet these studies also indicate that even with the erosion from whipsaws, a well-planned trend-following method can work well over manymarket cycles. If the moving average is chosen carefully, the advantageof participating in all the major market advances and being out of allthe major declines outweighs the alternative of buying and holdingover long periods, even when losses from whipsaws are factored in.Back-testing through all types of markets would appear to confirm thisassertion.Another fact becomes obvious after studying Figure 8.6: During longadvancing markets, such as the ones from 1949 to 1966 and from 1982until 2000, almost any trend-following technique underperforms thesimple buy-and-hold strategy. During these periods, the declines are seldom big enough to produce a benefit by trying to time them, and thewhipsaws erode the results. The gain using moving averages occurs primarily in a negative way, by avoiding the major declines. At these times,trend following adds value by allowing the investor to avoid giving thegains back during severe declines. We can see how trend following usingmoving averages would begin to make sense during an extended tradingrange market, such as the one I think we’ve entered.You can see all this in Figure 8.6. As just said, the buy-and-holdstrategy does better than moving average strategies during long bull markets (1949 to 1968 and 1982 to 1999), but the moving average strategygains substantially on buy and hold during corrective periods. It seemsthat the sum total of the whipsaws—losing during long bull markets but
180
TRADING RANGE INVESTMENT STATEGIES
gaining during certain declines—adds up to an overall positive result fora carefully planned trend-following method.The original study, besides presenting this interesting result, introduces you to the concept of timing using moving averages. It shows thebasic method of testing how they work and how to display and comparethe results. This prepares you for the new study, which focused not onthe whole 70 years, but on the last major trading range—the 16.5-yearperiod from 1966 to 1982. What moving-average strategies would haveworked the best through just that period?
THE NEW MOVING-AVERAGE STUDY
TE
AMFLY
In the original 70-year study, the 130-day moving average performedbest. This 70-year period was actually composed of four separate marketperiods: the Great Depression, the 20-year post-WWII bull market, along 16-year sideways period (1966 to 1982), and the latest 18-year bullmarket. Through all these types of markets, the 130-day moving averagedid very well.Price declines during bear markets were big enough and long enoughfor the 130-day moving average to fit within the movements, causingselling close enough to the top and buying close enough to the bottom togain on the market. Nevertheless, the important point to note is that the130-day moving average was not optimized for any particular type ofmarket, it just did the best over the whole period. Therefore, we don’tknow if the 130-day moving average would be the best one to use if wethought the market was about to enter a long trading range period.The 1966 to 1982 PeriodFigure 8.7 shows the S&P 500 from 1950 through 1982, with the periodfrom 1966 to 1982 highlighted. Between the years 1966 and 1982, themarket moved back and forth in a broad trading range (although theS&P 500 doesn’t show it as clearly as the Dow does, the consensus is thatthe postwar bull market ended in 1966 when the Dow hit 1,000). I believe we are entering a similar trading range period but with a muchsmaller time frame, from 5 to 7 years. This previous period, however,might provide a good testing ground for moving-average strategies thatmight work the best through a trading range period.
THE NEW MOVING-AVERAGE STUDY
181
FIGURE 8.7 January 1966 to August 1982 is the period for testing strategiesthat might work during an extended trading range market.160
S&P 500
120
80
40
01950
1960
1970
1980
1950–1982
Adding More Dimension to Moving AveragesThe research task is simple: Test every moving average just as before, butlimit the period to 1966 to 1982. These moving averages aren’t magical;they don’t predict the economic situation or the market. They are usedonly as a trend-defining mechanism. The goal is to determine whichmoving average defines or catches the best trends of the market duringthe most recent extended trading range.I could have performed the new study in the simple way just described, but I also wanted to test a new idea at this time. Remember thatthe moving average trend method always gives signals after a top or bottom. If you don’t get in at the bottom or out near the top, you often missa large part of a move. If the price moves during the trading range arenot large, these misses could be important. In addition, back-and-forthmovements of the market might increase the number of whipsaws.Therefore, it is worthwhile to find a strategy that also tries to locate topsand bottoms of the trading ranges.
182
TRADING RANGE INVESTMENT STATEGIES
The problem is that you know where the tops and bottoms of a rangeare only after the range has existed for a while. What if, by careful mathematical selection, it were possible to find the approximate tops and bottoms in past trading-range stock markets? A strategy might then be setup in anticipation of a similar type of movement. I reasoned that the bestchance of finding these past extremes might be a technical tool calledBollinger bands.Bollinger BandsThe best way to explain Bollinger bands is to show them to you. You candefine a set of Bollinger bands for every moving average. Figure 8.8shows a set of Bollinger bands for a moving average of 132 days (why Ichose 132 days will become evident later). The moving average is thecenter line, with Bollinger bands above and below. Each band is equidistant from the moving average. Notice that at times the two bands movecloser to each other and at other times they separate. How are thesebands determined and why does this happen?Sometimes the stock market becomes very active and prices movearound a lot. At other times, prices can become tame and move slowly.This is volatility. We measure volatility according to standard deviation,a mathematical measure of how far above or below a moving averageprices move. Bollinger bands are calculated using this standard deviation. When volatility is high, the top and bottom bands separate, givingthe market more room to fluctuate. When volatility is low, the bandscome together, allowing for less price change. Bollinger bands are goodcandidates for a mathematical cutoff to define the tops and bottoms ofprice ranges. Bollinger bands aren’t fixed; they allow the top and bottomof a range to adjust as stock market conditions change.At John Bollinger’s Web site (www.bollingerbands.com), his exampleof Bollinger bands uses two standard deviations as the separation be-
Bollinger bands are a mathematical technique developed by markettechnician John Bollinger that uses market volatility (standard deviation) to produce two bands, or lines, that bracket a price movement.Each moving average has its own set of bands.
THE NEW MOVING-AVERAGE STUDY
183
FIGURE 8.8 Sample of Bollinger bands. These bands, developed andpopularized by market technician John Bollinger, may be a great tool forbracketing a trading range if one believes the market has entered such a period(buy at the low band and sell at the high band). The bands shown are those ofthe 132-day moving average using a 2s factor (twice the standard deviation).1301201001009090806050401965
1970
1975
tween the moving average and the top and bottom bands. In fact, theseparation of the two lines could be at any multiple of the standard deviation. In my study, I tested every possible multiple of separation andfound that the two-standard-deviation bands, as John Bollinger definedthem, worked very well.Which Bollinger Band Is Best?We know that each moving average has its own unique set of Bollingerbands. Shorter-term moving averages have