A3_EI - Duke University`s Fuqua School of Business

FINANCE 453 – Global Asset Allocation and Stock Selection
Final Project: The Dual Simple Moving Average Crossover
Submitted by: Emerging Investors
Javier Hazan
Sergio Kurlat
Felipe Monteiro
Eugen Nuri
The Fuqua School of Business
Duke University
February 28, 2005
Table of Contents
1.
2.
3.
4.
5.
6.
7.
8.
Executive summary
The use of MA in technical analysis
One moving average
Multiple moving averages
The Dual Simple Moving Average Crossover
Data and Methodology
Results
Conclusions
2
1. Executive Summary
Moving Averages are widely used technical indicators. In principle they are easy to use
due to its mathematical simplicity. But implementation issues such as establishing the
optimal length of the MAs, telling the difference between crossovers that have some
“momentum” (either up or down) and those that will quickly revert, and knowing the
universe of stocks where this method will be more profitable, are all arduous tasks in
practice.
For this paper we designed and tested four different approaches to DMAC, and applied
them to the S&P 500 over 10 years using Factset. Among other topics, we explore here
issues such as trading on expected crossover versus trading afterwards, normalization of
price movements, and optimal time intervals between measurements.
Our results suggest that there might be some momentum after crossover occurs, so the
traditional approach (trading only after crossover instead of anticipating it) leads to better
results. We also suggest some possible improvements to our tests.
2. The use of Moving Averages in Technical Analysis
Moving Averages are the most versatile and widely used technical indicator. A moving
average is an average of a fixed number of consecutive prices, updated each time a new
price is posted. It is designed to smooth out temporary price fluctuations and reveal the
true path of the underlying trend.
Moving averages are most often used in combination. That is, two or three moving
averages of different length are employed. A common combination is the 4-day, 9-day
and 18-day moving average. When the 4-day MA crosses above the 9-day, you've got a
"fast" buy signal. If it crosses below the 9-day, you've got a fast sell signal. And if the 9day crosses the 18-day, you've got a "slow" signal, but it's even stronger confirmation of
a trend change or an acceleration of an existing trend. That's why many traders wait for a
"slow" moving average signal to enter a trade, but will exit the trade on a "fast" signal to
protect profits or limit losses.
By their nature, even "fast" moving average signals lag the market and thus cannot get
you in or out of a market at precisely the best time. But they are very helpful in keeping
you from overreacting to minor, temporary price aberrations.
While chart analysis is largely subjective, moving averages are mathematically precise
and objective. One of the reasons moving averages are so popular is that they embody
some of the most common stipulations of successful futures trading. They keep investors
from responding to every little zigzag in the market because it either takes a huge single
day move or several days' trade counter to the trend before a moving average will tell you
to buy or sell. That's why they work best in broad, trending markets, although they can
performed poorly in the presence of jagged price series.
3
By utilizing moving averages, investors attempt to smooth out or eliminate the random
day-to-day price fluctuations. However, the DMAC does not predict market action in the
same sense that standard chart analysis attempts to do. As noted earlier, moving averages
never anticipate, they only react.
Simple moving averages (or arithmetic means) are probably the most widely used,
predominately because of its ease of computation. Two criticisms are usually directed at
the usage of simple moving averages. First, only the period of the average is considered.
The second criticism is that simple moving averages give equal weighting to each day.
Some analysts believe, however, that the more recent data should receive a heavier
weighting.
Weighted averages place gradually greater emphasis on more recent data. The advantage
of weighting is that this type of average reverses direction more quickly than a simple
moving average. To calculate a 10-day average, today's closing (high, low, midpoint or
average) price would be multiplied by ten, yesterday's close would be multiplied by nine,
and so forth. This total is then divided by 10.
Exponential averages use a smoothing constant, referred to as alpha. Exponents are
calculated by dividing 2 by the desired time span. Example: The alpha for a 10-day
Exponential Moving average would divide 2 by 10.
3. One moving average
Employed by a number of traders to determine the trend of the market. The average is
plotted on the bar chart in its appropriate trading day along with that day's price action.
When the closing price moves above the moving average, a buy signal is given; and when
it closes below the moving average, a sell signal is generated. For added confirmation,
some technicians like to also see the moving average turn in the direction of the trade.
If a short term average is utilized, the average tracks closing prices very closely and
several crossings can occur in a short period of time. This has its advantages and
drawbacks. The use of very sensitive moving averages signals more trades (with higher
commission costs) and picks up many false signals. If the average is too sensitive, some
of the short-term random price moves (noise) activates trend signals during non-trending
periods.
While shorter averages generate more false signals, they have the advantage of giving
trend signals earlier in the move. We are trying to find an average that is sensitive enough
to generate early signals, yet steady enough to avoid random noise is a difficult task. The
process is often called "optimization" because you are seeking the combination of
averages that would have produced optimum trading results in the past. (however, just
because the system would have produced optimal results in the past, it does not imply
that it will deliver optimal results in the future.) The best alternative is to employ another
indicator as a filter. The following is a list of some of those filters.
4
1. Besides requiring that the prices close beyond a moving average line, some technicians
require that the entire day's price range clear the average.
2. Another variation requires that the closing price go beyond the moving average by a
predetermined amount. This amount can either be based on a percentage or a minimum
fluctuation.
3. Other technicians also require that a moving average signal be confirmed by a breakout
on the chart as well. This renders even a stronger signal and helps eliminate whipsaw.
4. Time filters are also employed by some traders. In these cases one or more days may
be needed beyond the moving average to signal an entry. Because most bad signals
reverse quickly, the requirement that the signal remain in force for a predefined period of
time helps detect weak or false signals.
5. Utilizing percentage envelopes, or volatility bands is another popular filter. Here,
parallel lines are drawn at percentage points above and below the moving average. Buy
signals are given when the market closes above the upper band. Conversely, a sell signal
is given when the market closes below the lower band. Exit signals are given when the
market closes through the basic moving average.
6. High-low bands can also be used. These are constructed using the highs and lows
instead of the close to calculate their placement. A close above the moving average of the
high is used for buy orders, a close below the lower moving average is used for sell
orders.
4. Multiple moving averages
Using a single moving average has advantages as well as disadvantages. At times shorter
moving averages work better than longer averages. The use of a single moving average,
however, also generates a number of unprofitable trades -- referred to as whipsaws -- that
require the use of filters. To improve effectiveness and dependability, many technicians
elect to use two or three moving averages together.
When two moving averages are used together, the longer term moving average is used to
help identify the trend, and the shorter one for timing purposes. It is the interplay of the
two averages and price itself that produce buy or sell signals.
Typically dual moving averages utilize a crossover method. Buy signals are given when
the faster moving average moves above the slower moving average. Sell signals are given
when the faster moving average falls below the slower moving average. Popular
combinations are 4 and 9, 5 and 20 and 10 and 40 day averages.
A triple moving average crossover is yet another variation. The most widely used
crossover method is the 4, 9, and 18-day moving average. Here, buy signals are given
when the 4-day average moves above the 9-day and 18-day average. Sell signals are
5
given when the 4-day average falls below the 9-day and 18-day average. Some traders
take the initial crossover as an indicator to start liquidating any positions, and wait until
the 9-day average crosses the 18-day average to take any new positions. Dual Simple
Moving Average Crossover is used to limit the amount of false signals generated by the
Simple Moving Average Price Crossover. The Dual SMA crossover generates far fewer
trading signals than SMA Price Crossover systems, and increases the profitability of the
trading system used.
5. The Dual Simple Moving Average Crossover
Typically, the Moving Averages used in the Dual Simple Moving Average Crossover
system are related on an 8 to 1 ratio. This means if the first Simple Moving Average used
is a 5 day SMA, then the second should be a 40 day Simple Moving Average.
The buy and sell signals are generated when the faster Simple Moving Average crosses a
slower Simple Moving Average. The faster Simple Moving Average is the one with a
lower day period. The slower Simple Moving Average is the one with a higher day
period. For example, in the trading system with 50 and 200 days Simple Moving
Averages the Faster simple moving averages is the 50 days SMA, and the Slower simple
moving average is the 200 days SMA.
The BUY and SELL signal generation: When the faster Simple Moving Average has
been below the slower Simple Moving Average and crosses above the Slower SMA, a
BUY signal is generated. When the faster Simple Moving Average has been above the
slower Simple Moving Average and crosses below the Slower SMA, a SELL signal is
generated.
6. Data and Methodology
We designed four separate experiments in order to test the DMAC hypothesis. We ran
these experiments in Factset. Our dataset was the S&P 500 for the period January 1995 January 2005. In each test, the dataset was split into a “short below long MA” and “short
above long MA” parts, assigned a sorting factor, and rebalanced once a month. The four
tests can be briefly described as follows:
(a)
“Ratio before crossover”: After selecting only those stocks whose short MA was
below its long MA, we calculated the ratio of the distance between MAs at t=0, and
divided by the distance between MAs at t-1. Therefore, the lower the ratio, the closer we
are to the crossover point, and the stronger the signal to buy.
6
Buy signal
Conversely, we selected a second sample for the same t=0; in this new sample we only
have points whose short MA was above its long MA. We also calculated the ratio
between distance at t=0 and distance at t-1. In this case, the lower the ratio, the closer we
are to the crossover point, and the stronger the signal to sell.
Sell signal
We are aware that, as we are just guessing when a crossover is likely to occur, our system
will pick up false signals (i.e. movements of the short MA approaching the long MA, but
ultimately reversing this trend and getting farther from the long MA after we trade).
7
However, there is also a tradeoff that makes this test worthwhile: if we are –on average-successful at trading before the crossover occurs, we will benefit from a larger proportion
of the upward movement. In other words, a trader who waited to buy until the crossover
occurred, has already lost a part of the stock appreciation (and he is not immune to a
quick reversal either).
(b)
“Unit Ratio”: With this method, we calculate ratio of the differences between the
two MAs (short minus long) at t=0 ant t=t-1. Then, we calculate the difference between
this ratio and one, and square the result (we want to make the difference between this
ratio and one artificially big, for fractile sorting purposes). Just as before, we run the
experiment twice: first, for short MA < long MA, and then the opposite.
The reasoning behind this method is that, if the stock price has gone through
approximately a half-cycle, then this ratio will be equal to one. In the extreme case, we
know that, if the stock price has stayed in a peak or a trough between t-1 and t, then the
ratio will be one and we will benefit from ALL the upward (if we go long) or downward
(if we short) movement.
Sell signal
Buy signal
(c) “Ratio after crossover”: In this test, we use the more traditional approach of
waiting after the crossover has occurred, and then running our calculations.
Specifically, we obtain our BUY signals from those stock prices whose short MA
is currently above the long MA, but were in the opposite situation at t-1. The
magnitude of the distance between MAs (one after the crossover, one before) is
the sorting mechanism for the fractiles. Then, we conduct the same experiment,
for stocks whose short MA crossed the long MA from above (i.e. going down).
8
The magnitude of the ratio of distances will generate the fractile that we will
short.
Buy signal
Sell signal
(d) “Product after crossover”: This procedure is similar to the previous one, except
that we product of the distances instead of the ratio as the sorting mechanism.
7. Results
“Ratio before crossover”: As we explained above, the sorting factor was the following:
pt3  pt12
pt31  pt121
,
where:
 subscripts indicate period (t=0 is the day when the return is calculated, while the
specific time interval between t and t-1 varies depending on the model)
 superscripts indicate the number of months over which the average price was
calculated
In this case, the lag between t and t-1 is 15 days (so, for example, p12(t-1) is the average
price between 380 and 15 days ago).
The graphs below show the deciles for the ‘long’ (i.e. short MA below long MA) and
‘short’ (short MA above long MA) parts of the experiment. We decided to use deciles in
order to strictly capture only those stocks that were moving clearly towards a crossover.
9
Ratio before crossover (deciles, long)
2.00
1.80
1.60
1.40
1.20
1.00
0.80
0.60
0.40
0.20
0.00
1
2
3
4
5
6
7
8
9
10
Small factor magnitude (i.e. points very close to crossover from below) were placed in
the first fractile.
Ratio before crossover (deciles, short)
2.00
1.50
1.00
0.50
0.00
1
2
3
4
5
6
7
8
9
10
In this graph, small factor magnitude (i.e. points very close to crossover from above) was
placed in the 10th decile.
Therefore, it is useful to compare both the first and last deciles of each test, and the first
decile of the ‘long’ (or BUY) part, versus the last decile of the ‘short’ (or SELL) part.
We do not notice differences in returns so large that would justify a long-short strategy.
Furthermore, the slight differences in returns that we see in the ‘long’ chart are
overridden by large standard deviations (see data in excel appendices).
10
“Unit Ratio”: Here, the sorting factor was the following:
 pt3  pt12


 1
 p 3  p12

t 1
 t 1

2
The first fractile corresponds to small factor magnitudes. In other words, we’ll see in the
first fractile those stocks whose rayio is close to one, so we expect there is strong reason
to either buy (if short MA is below long MA) or sell (if short MA is above long MA).
Unit Ratio (deciles, long)
1.80
1.60
1.40
1.20
1.00
0.80
0.60
0.40
0.20
0.00
1
2
3
4
5
6
7
8
9
8
9
10
Unit ratio (deciles, short)
2.50
2.00
1.50
1.00
0.50
0.00
1
2
3
4
5
6
7
10
A long-short strategy would be supported by:
 First decile larger than any other in ‘long’ chart (i.e. if we are in a trough, we then
experience the largest return)
 First decile smaller than any other in ‘short’ chart (i.e. if we are in a peak, we then
experience the smallest return)
 Significant difference between first decile of ‘long’ (gains from buying in a
trough) and first decile of ‘short’ (gains from buying in a peak)
11
As we can see, the results do not support a long-short strategy based on this test.
“Ratio after crossover”: The sorting factor was:
pt3  pt12
pt31  p t121
,
where:
 the numerator and the denominator were on opposite sides of the crossover point
(for the ‘long’ part of the test, t-1 is before the crossover and t is after the
crossover; the reverse is true for the ‘short’ part of the test)
 in this experiment, we used a 5-day lag between t-1 and t in order to account for
sudden changes around the crossover point
 returns coming from a big magnitude sorting factor were placed in the first
fractile. Therefore, a big first fractile in the ‘long’ part would imply good
performance for stocks for which an accelerating upward movement is taking
place. A small first fractile in the ‘short’ part means poor returns when an
accelerating fall in stock price is taking place.
ratio after crossover (quintiles, long)
2.50
2.00
1.50
1.00
0.50
0.00
1
2
3
4
5
ratio after crossover (quintiles, short)
2.50
2.00
1.50
1.00
0.50
0.00
1
2
3
4
12
5
These results are very encouraging. The noticeable difference between the two first
quintiles suggests that a good strategy is to wait for the crossover to occur, then buy
the rapidly rising stocks and short the rapidly falling ones.
In fact, the results from the first quintile of the ‘long’ part compare favorably to the
S&P 500. Therefore, simply going long in these stocks is a good investment.
Comparative Returns
25.00%
Annual Return
20.00%
15.00%
Long Fractile 1
S&P500
10.00%
5.00%
0.00%
1996
1997
1998
1999
2000
2001
2002
2003
2004
Year
Sharpe Ratio
4.50
4.00
3.50
Ratio
3.00
2.50
Long Fractile 1
2.00
S&P500
1.50
1.00
0.50
0.00
-0.50
1996
1997
1998
1999
2000
2001
2002
2003
2004
Year
Finally, we must keep in mind that there is an important timing element here. Because
we are buying stocks with rapidly rising prices after we’ve detected this behavior
(instead of anticipating it), there is a risk that, by the time we buy, the momentum is
already exhausted (i.e. we got late in the game and the stock won’t go up anymore).
An analogous argument can be applied to the shorting part. Further research may try
to establish the optimal lag between t-1 and t. If we reduce this interval, we can
13
hypothesize that the unfavorable effect of picking up more false signals would
possibly be offset by the advantages of rapidly perceiving abrupt price movements.
“Product after crossover”: The sorting factor was:
p
3
t

 pt12  pt31  pt121

,
where:



the numerator and the denominator were on opposite sides of the crossover point
we used again a 5-day lag between t-1 and t in order to account for sudden
changes around the crossover point
returns coming from a big magnitude sorting factor were placed in the first
fractile. Therefore, a big first fractile in the ‘long’ part would imply good
performance for stocks for which an accelerating upward movement is taking
place. The accelerating effect is stressed here even more than in the previous
model. A small first fractile in the ‘short’ part means poor returns when an
accelerating fall in stock price is taking place.
Product after crossover (quintiles, long)
3.00
2.50
2.00
1.50
1.00
0.50
0.00
1
2
3
4
14
5
Product after crossover (quintiles, short)
2.50
2.00
1.50
1.00
0.50
0.00
1
2
3
4
5
-0.50
This is an interesting result. Although the difference between returns in two first quintiles
is not as large as before (and is certainly less reliable when we consider the large standard
deviations – see excel appendices), there is a decreasing pattern in the last four quintiles
of the ‘long’ part. This suggests that we could go long in rapidly rising stocks and short
slowly rising stocks (i.e. investing only in the short-MA-below-long-MA stocks). The
evidence is inconclusive due to large standard deviations, but the subject certainly
warrants more research.
In addition to the large variance problem mentioned above, we are aware that this is the
most biased of all our tests: instead of normalizing distances between MAs, we multiply
them, and so we tend to place in the first quintile stocks with higher absolute price. Once
again, the pattern observed in the ‘long’ chart suggests that should try to ‘salvage’ this
model using some form of normalization of stock prices.
8. Conclusions
We’ve explored four different approaches to the DMAC. In the first two models, we
allocated our investments based on fluctuations before the crossover. Although the idea
of anticipating (or rather trying to anticipate) crossovers is appealing (we would get to
benefit from the whole change in a particular price, while avoiding the risk of buying or
selling when it’s already too late), our results suggest that this is exceedingly difficult. In
addition to the well-known problem of false signals, we also face the problem of
calibrating correctly the optimal time interval (t-1 to t) that separates the two distances. A
more complex model should at least attempt to reduce false signals by combining several
ratios between distances in one single factor (i.e. combine ratio between t and t-1, with
ratio between t and t-2, etc.), so the investor would get a stronger indication that a
crossover is approaching.
15
The models where the traditional approach is used (calculations performed after
crossover) seem so far more reliable. We already suggested a few improvements that one
could use in the case of the “product after crossover” model. The most promising model
of all, the “ratio after crossover”, can be further refined through a better adjustment of
time intervals (length of each MA, and distance between t and t-1). In general, the “ratio
after crossover” model seems a promising tool for stock selection.
16