ING
traders who find that method too slow. Instead they buy when prices moveabove the moving average and sell when they move below.The problem with using a price penetration for buy and sell signals is thatprice can move back and forth through the moving average for a number ofdays before taking off in one direction. In Figure 4.1, both the slowest andmedium trends have this problem. There are some added rules that can beused to avoid this, but those rules also have problems. Why go through thetrouble of more complicated rules when you end up at the same place?Two Microsoft Examples. If we take a similar period for Microsoft(MSFT), 1995–2001 (see Figure 4.2), we see much the same pattern as Enron.The 20-, 40-, and 80-week averages have one primary upward trend and onedownward trend. Neither the 40- or 80-week averages has any false trend signals, while the 20-week is much more erratic than in the Enron example.Longer is smoother.The daily chart of Microsoft shown in Figure 4.3 uses days rather thanweeks for the moving average calculations. The 20-, 40-, and 80-day moving
204080
FIGURE 4.2
Microsoft weekly chart, 1995–2001. The 20-, 40-, and 80-week averagesshow a pattern similar to Enron.
55
Calculating the Trend
804020
FIGURE 4.3
Microsoft with 20-, 40-, and 80-day moving averages. Because daily data ismuch noisier than weekly data, none of the moving averages are as smooth as the weekly onesin Figure 4.2.
averages are all much faster than the fastest weekly average (20 weeks isequivalent to 100 days); therefore, the trendlines track the prices closely andhave frequent changes in direction.In the daily chart, all of the moving averages seem to catch a good part ofeach trend. The 20-day average has a series of shorter trades, while the 80day average has fewer, larger, and longer trades. The 80-day seems to do thebest, holding the downtrend for the entire move lower. However, how do weknow that the results of the 80-day average are better than the 20-day? Eventhough the 20-day has a few bad trades, the total of all buys and sells usingthe faster trend might be greater than the 80-day result.To find out which trend is the best, you’ll need to add up all the trades. Inaddition, you’ll want to know which trend has the largest loss. Both theamount of profit and the size of the risk decide the best trend.Conservation of Capital. Before showing the actual trades generated by amoving average system, you should know that a trend system is a conservation of capital approach. It takes many small losses and has a few large
56
A SHORT COURSE IN TECHNICAL TRADING
FIGURE 4.4
Microsoft moving average performance statistics.
profits. The small losses occur when we enter a new trade and prices turnand go the wrong way. The moving average trend changes within one or twodays, and we close out the trade with a small loss. Taking a small loss iscalled conservation of capital.Results of an 80-Day Moving Average Applied to Microsoft. Figure 4.4shows a summary of the trades for Microsoft using an 80-day moving averagefor the 10 years ending January 2001. This system traded both the long andshort side There were a total of 88 trades, of which 36 were profitable, onlyabout 40 percent. That’s actually good for a trend system which often hascloser to 35 percent good trades. Total profits were $51.75, which means anaverage trade made $0.59 before commissions.An interesting result in this trend system is that there are 7 bars (in thiscase “bars” mean “days”) in the losing trades and 46 bars in the winningtrades. That shows the system is holding onto profits and cutting lossesshort. Also, the average winning trade yielded $3.32, and the average loss was$1.22. The losses are smaller and the losing trades are exited faster than theprofitable trades—it must be a trend system. Study the trades in Figure 4.5 tosee a typical trend performance.
Calculating the Trend
FIGURE 4.5
57
Microsoft moving average sample trades.
EXPONENTIAL (PERCENTAGE) SMOOTHINGMoving averages are not the only way to smooth prices. Exponential smoothing is another simple technique that came out of the aerospace industry. Itwas a way of calculating the trajectory of a missile. The name is the mostcomplicated part of it. If we had called it percentage smoothing, it would notsound as intimidating. Never let the mathematicians name something.If you want a trendline smoothed by 20 percent, then each day you bringthe last trendline value closer to the last closing price by 20 percent of the distance between the two values. For example, if yesterday’s trendline valuewas $50, today’s price is $60, and your smoothing is 20 percent, then the newtrendline value is:New exponential value = old exponential value+ 0.20 × (today’s price − old exponential value)= 50 + 0.20 × (60 − 50)= 50 + 2= 52A 20 percent smoothing causes the trendline to move closer by $2 whenthe new closing price is $10 away from the previous trendline value. That’s20 percent of $10, the difference between $60 and $50. One of the good points
58
A SHORT COURSE IN TECHNICAL TRADING
804020
FIGURE 4.6
Daily Microsoft chart with percentage smoothing equivalent to 20-, 40-,and 80-day moving averages. The trendlines seem a bit more sensitive than the movingaverage equivalent because the smoothing is a front-weighted method; moving average isequally weighted.
of exponential smoothing is that it only needs the value of the previous trendline, the new price, and a smoothing (percentage) value (see Figure 4.6). Amoving average needs as many prices as the length of the average. The rulesfor trading a smoothed trendline are the same as those for a moving average.You trade in the direction of the trendline.
Finding a Moving Average and Smoothing PercentageThat Gives the Same TrendlineAlthough the calculations seem very different, we can come close to findinga moving average trendline and a smoothed trendline that are very similar.Beginning with the number of days in the moving average calculation, we canfind the equivalent smoothing value using the formula:Exponential smoothing percentage =
2(moving average calculation period + 1)
Then a 20-day moving average has an equivalent smoothing percentage of 2 / 21= 0.095, a 40-day moving average is 2 / 41 = 0.049, and an 80-day moving average is 2 / 81 = 0.0247.
59
Calculating the Trend
An advantage of smoothing is that you can select values that represent a2.5-day moving average while it is impossible to actually average 2.5 daysusing daily data. If we want to go from smoothing to a moving average, wecan reverse the formula:Moving average calculation period =
2exponential smoothing percentage − 1
Smoothing Gives More Importance to Recent Price MovesThe important difference between a moving average and smoothing isthat smoothing gives greater importance to the most recent data. Thinkof a 10 percent smoothing as the same as a company continually diluting itself by giving 10 percent of the total company to each new shareholder. If there are 20 original shareholders, each with 5 percent of thecompany, and a new shareholder gets 10 percent, then each of the 20 original shareholders ends up with 4.5 percent (10 percent less) and the newshareholder has 10 percent.If another shareholder is now issued 10 percent, the original shareholders are diluted to 4.05 percent, the previous 10 percent owner now has 9 percent, and the new shareholder has 10 percent. Each time a new shareholderis added at 10 percent, all previous shareholders are diluted by 10 percent.The most recent addition will always have 10 percent, the previous one 9 percent, the one before that 8.1 percent, then 7.29 percent, and so on. This typeof trend is also called front-weighted.
REGRESSION SLOPESA regression line is the “best” straight line drawn through the prices to showthe direction. The angle up or down is the slope of the line. It is the methodused by economists and is similar to our charting trendlines except that it isdrawn through the center of the price move rather than across the highs andlows. The calculation of the slope takes more time than we would like; therefore, it’s best to use the function slope on a spreadsheet and follow the example at end of this chapter.When you draw a trendline on a daily chart, the slope of that line is theamount that it rises or falls each day. For example, if we draw a rising linefor IBM that goes from $50 to $70 over 20 days, the slope of that line is 1 ($1increase per day). If it falls to $60 over the next 20 days, then the slope during that period was −0.50 (50¢ decline per day).
60
A SHORT COURSE IN TECHNICAL TRADING
FIGURE 4.7 Microsoft daily chart with regression lines of about 6 months. Each lineshows the direction of prices during the period and runs through the middle of the pricemovement.
Figure 4.7 gives an example of regression lines drawn at different pointsin time. Each line includes about six months and runs through the middle ofthe price pattern.When we use the slope for trading, we are only interested in the mostrecent slope value. If the slope is rising, then the trend is up; if it is falling,then the trend is down. We use it in the same way as the previous trends. Achart of the slope is shown in Figure 4.8 along the bottom of the chart andalso in the top part of the chart. Because each point of the slope is measuredover the previous six months, the daily increase or decrease in price is verysmall. When MSFT declines from $120 to $60 (December 1999–June 2000),the daily slope was −0.40 (an average of 40¢ per day).The slope has small values that the can be both positive and negativebased on whether the regression line is angling up or down; therefore, it isvery different from prices and cannot be plotted on the same chart scale. Thetrendline on the price chart is drawn to give you an idea of what the slopewould be at different points. The slope value that we want is the angle of theline as it changes each day. The line plotted along the bottom shows the trueslope. The angle of the line is rising when the slope value is above zero and
Calculating the Trend
61
FIGURE 4.8
Microsoft with slope. The last point of the 125-day regression line is plottedon the price chart, and the slope value is plotted along the bottom.
falling when it is below zero. The larger the value, the stronger the upwardprice move.Although the slope seems to be falling from January to June of 2000, it isactually rising at a slower rate from January to May. Any slope value abovezero means that prices are rising. When it crosses the zero line, it then indicates that prices are falling.
BREAKOUTSWe have already discussed the N-day breakout in Chapter 3. It is both a verypopular and very reliable way of identifying the trend. To review the tradingrules:
Breakout Rule 1Buy on an upward penetration of the highest high of the past N daysSell on a downward penetration of the lowest low of the past N days
62
A SHORT COURSE IN TECHNICAL TRADING
There are alternative rules that are considered more conservative and avoidentering on days when there is a higher high but prices close back inside thetrading range. This situation is potentially a false breakout, and can beavoided with Rule 2.
Breakout Rule 2Buy when prices close above the highest high of the past N days.Sell when prices close below the lowest low of the past N days.The drawback of Rule 2 is that it may keep you out while prices are movingsteadily higher or lower. That leads to Rule 3.
Breakout Rule 3Buy if there is an N-day high and today’s close is higher than yesterday’sclose.Sell if there is an N-day low and today’s close is lower than yesterday’sclose.
−1Sell #2
Buy #21
−1Sell #2−1Sell #2
−1Sell #2
Buy #21
Buy #21
Buy #21
FIGURE 4.9 Microsoft trading signals using a 20-day breakout. Lines have been drawnat the points where the breakouts occur. As with other trend methods, it takes more small lossesand a few large profits.
Calculating the Trend
63
Of the three rules, Rule 3 may be the best compromise. It avoids false breakouts and gets a confirmation from the higher closing price.Figure 4.9 shows the Microsoft buy and sell signals using a 20-day breakout. Lines have been drawn across the chart at the point where a trading signals occurs.
WHICH OF THE FOUR TRENDING METHODS IS BEST?Now that we’ve looked at the four most important trending techniques, wenaturally want to know which is best. To get that answer, we need to use special testing software that will give us the results of trading the trends for calculation periods from 5 to 200 days. This way we can see which methodswork best for faster or slower trading, and which work best in general overthe entire range of tests.Table 4.1 gives the results of testing Microsoft for five years ending January 2002. This period has a strong bull market at the beginning, changing toa volatile sideways pattern and then lower prices towards the end of theperiod. Some of the important features to notice are:• Except for the calculation periods from $20 to $55, all tests were profitable. It is interesting to note that the range $20 to $55 is the most popular for trend followers.• Profits all were made with long positions rather than shorts. Long positions had the largest losses using averages in the range of 45 to 50 days;the shorts were only profitable in the range of 10 to 15 days. That’sbecause price drops are shorter and more volatile than price rises. Inorder to profit on the short side, you need to trade quickly and get out.Because the market has a long-term history of reaching new highs,slower trends work better for long positions.• The average profit from a trade gets larger as the trend gets slower. Fasttrading in the range from 10 to 15 days may look attractive, but an average return of 29¢ to 38¢ per trade can be eaten up quickly with commissions and a few bad executions in a fast market.• The profit factor (gross profits divided by gross losses) get much higheras the trend gets slower. The profit factor measures the smoothness ofthe returns, although this measure only looks at the returns after thetrade is closed. Still, it argues that slower is better, as do many of theother values.
64
A SHORT COURSE IN TECHNICAL TRADING
TABLE 4.1
Results of Backtesting a Moving Average for Microsoft over the FiveYears Ending January 2002
Period
NetPrft
L:NetPrft S:NetPrft
#Trds
5101520253035404550556065707580859095100105110115120125130135140145150155160165170175180185190195200
1.1697.08102.90−25.78−16.95−67.26−1.39−61.31−73.87−73.79−39.5014.232.5075.4642.3347.7259.1044.1550.46-9.7127.4876.1878.9056.8359.6453.6176.4265.0585.15116.9581.1362.1042.8052.9871.7584.2484.2684.3180.6577.35
29.6971.1175.9612.1820.63−4.5328.19−0.36−10.61−13.7312.3332.1630.3666.8450.2753.9358.6652.9057.8727.8546.0071.2071.5360.4960.9354.0770.2963.6374.6590.5583.4272.6661.9155.6076.3986.1486.1586.1782.0979.19
−28.5325.9726.94−37.96−37.58−62.73−29.58−60.94−63.26−60.07−51.83−17.93−27.868.62−7.94−6.210.44−8.76−7.41−37.56−18.534.987.37−3.66−1.29−0.466.131.4210.5026.40−2.30−10.56−19.12−2.62−4.64−1.90−1.88−1.86−1.44−1.84
535338274246192212212182185151149145147103116102977979898961516365796563554135313737273119171913
%Prft Avg W/L AvgTrd
302.29284.12314.02232.78282.22241.90252.90242.05231.88212.06232.30263.05272.72324.69254.29343.24373.29353.23246.39154.89253.6818 13.0523 11.98208.75275.61304.20307.36267.80299.8543 11.99457.8425 10.90275.51275.6125 13.7529 63.2126 73.4829 64.8721 113.1723 36.38
MaxDD
PFact
0.00 −47.920.29 −20.450.38 −22.50−0.11 −67.12−0.09 −42.37−0.32 −75.24−0.01 −36.50−0.34 −86.32−0.40 −99.83−0.49 −124.12−0.27 −83.890.10 −76.680.02 −93.410.73 −21.920.37 −28.990.47 −26.010.61 −18.140.56 −32.780.64 −38.01−0.11 −80.030.31 −66.501.25 −24.701.55 −16.810.90 −20.210.92 −31.160.68 −30.381.18 −11.381.03 −15.201.55 −11.712.85−7.052.32 −14.462.00 −17.941.16 −29.231.43 −38.252.66 −17.032.72−2.734.44−3.434.96−2.894.25−3.005.95−6.11
1.001.631.840.860.890.620.990.650.590.550.711.121.022.211.501.691.941.772.020.911.282.873.692.272.151.833.272.884.049.386.603.792.042.084.8125.8626.2427.0330.1810.91
Explanation of columns: (1) calculation period, (2) net profit, (3) profits from longtrades, (4) profits from short trades, (5) number of trades, (6) percentage of profitabletrades, (7) average win/loss ratio, (8) average profits per trade, (9) maximumdrawdown, and (10) profit factor (gross profits divided by gross losses).
65
Calculating the Trend
Comparing the Results of the Four TrendsThe same tests that are shown in Table 4.1 for the moving average were performed on the other three trending methods, smoothing, regression slope,and breakouts. The net profits of the four methods are shown together in Figure 4.10. The left scale is the net profit and the bottom scale is the calculationperiods from 5 through 200 days.Let’s not look at the chart too closely. You should see that the overallpattern of profitability is very similar for all four trend methods. All thelines move together. Sometimes one is a little better, sometimes another, butall of them peak at 15 days, drop to lows at about 35 days, and then movesteadily higher.
The Importance of Similar ResultsLet’s look at the big picture for a moment. Figure 4.10 says that, if a markethas price trends, then any of the trending methods should make money.That’s important. Each of these four methods is technically very different, aswe’ll see in the next section; nevertheless, the final picture is the same.
150.00
100.00
50.00MAEXPLRS
5
5
19
18
5
175
5
16
5
15
5
14
5
13
5
12
5
11
95
10
85
75
65
55
45
35
25
BO
15
5
0.00
-50.00
-100.00
-150.00Calculation period
FIGURE 4.10
Net profits of four trending methods. When viewing the big picture,all four methods have very similar results over all calculation periods.
66
A SHORT COURSE IN TECHNICAL TRADING
When you’re searching for the best trend for the market that you want totrade and you find that the breakout method gives reasonable profits but themoving average and smoothing methods lose money, then don’t trade thetrend. You need a market with clear trends, not subtle ones, to have confidence that trend following will work. Don’t think you’ve discovered a secretbecause only one method works. It was just an odd combination of price patterns that is not likely to be repeated in the future.
The Differences between Trending MethodsNow we can look at the features that make one trending method differentfrom another.Profits per Trade. Both the N-day breakout and the regression slope havenoticeably larger profits per trade than the moving average or smoothingmethods (see Figure 4.11). Larger profits per trade are safer for trading, butit is necessary to take larger risks in order to have larger profits. We’ve seenthat the moving average and smoothing techniques cut losses short, while the
30.00
25.00
20.00
15.00
MAEXPLRSBO
10.00
5.00
5
5
5
5
5
5
5
5
5
5
11
12
13
14
15
16
17
18
19
95
10
85
75
65
55
45
35
25
15
5
0.00
-5.00Calculation period
FIGURE 4.11 Comparison of profits per trade. The breakout and slope methods showmuch larger profits per trade than the moving average and smoothing techniques. In order to getthe same result, the breakout and slope techniques must take more risk.
67
Calculating the Trend
5
5
5
5
5
5
5
5
5
5
10
11
12
13
14
15
16
17
18
19
95
85
75
65
55
45
35
25
15
5
0.00
-20.00
-40.00
-60.00
MAEXPLRSBO
-80.00
-100.00
-120.00
-140.00Calculation period
FIGURE 4.12 Comparison of maximum drawdowns. There is an overall similar pattern,but the N-day breakout shows slightly larger losses in the short term and smaller losses in thelong term.
breakout and slope techniques allow prices to flop around in a wide range inorder to hold onto the trend. This difference in style can be seen in the largerprofits per trade for the breakout and slope methods.Drawdowns. The maximum drawdown is the peak-to-valley drop inequity, measured from day to day, rather than only when the trades areclosed out. In Figure 4.12 we again see a similar overall pattern of drawdowns in the four systems, although the N-day breakout has a slightly largerloss than the others when trading faster.Number of Trades. The frequency of trading is another significant difference in the style of the four techniques. When there are fewer trades, eachtrade must be held for a longer time, resulting in net larger profits and lossesand larger equity swings. In Figure 4.13 we can see that the moving averageand smoothing methods are similar in the way the number of trades declineas the calculation periods get larger (the trend gets slower). The moving average and smoothing techniques have many more trades than either the breakout or slope methods because no matter what speed is used, the moving
68
A SHORT COURSE IN TECHNICAL TRADING
600
500
400
MAEXP
300
LRSBO
200
100
5
5
5
5
5
5
5
5
5
5
10
11
12
13
14
15
16
17
18
19
95
85
75
65
55
45
35
25
15
5
0
Calculation period
FIGURE 4.13
Number of trades comparison. The moving average and smoothingmethods always have more trades than either the breakout or slope techniques because movingaverages will give a series of false signals during many of the trend changes.
average will get caught in a trend change that moves back and forth acrossthe trendline, causing a series of false signals. False signals are a fundamental part of the moving average approach and can’t be eliminated.Percentage of Profitable Trades. The last important quality of the systems is the percentage of profitable trades. We can see the similarity of themoving average and smoothing methods in Figure 4.14, each posting slightlyabove 30 percent at best, and falling to lower reliability as the number oftrades decline for slower trends. Even when the moving average is calculatedover a long time period in order to capture the major trend, it still producesa series of false signals at the trend change. When there are only a few goodtrends, these false signals become a larger percentage of the total number oftrades. As discussed earlier, this pattern is called conservation of capital.The breakout system is just the opposite. When a long time period isused, the highest high and lowest low are very far apart. It is unlikely thatthere will be more than one or two trades, and each trade will be heldthrough a wide range of price movements, most often yielding a net profit.
69
Calculating the Trend
90
80
70
60
50
MAEXPLRS
40
BO
30
20
10
5
5
5
5
5
5
5
5
5
5
10
11
12
13
14
15
16
17
18
19
95
85
75
65
55
45
35
25
15
5
0
Calculation period
FIGURE 4.14
Percentage of profitable trades comparison. The breakout system getsmore reliable for long-term trends, while the moving average and smoothing methods continueto generate false signals at trend turns.
The percentage of profitable trades goes up for the breakout system whenyou hold the trade longer, but the risk also goes up.Summary of Trend CharacteristicsNet profits
All systems have very similar net profits.
Profits per trade
All increase, but the N-day breakout is 5 timeslarger than the moving average or smoothingmethods.
Maximum drawdown
Similar for all methods, but more uniform for theslope and N-day breakout.
Number of trades
N-day breakout and slope have less than half thenumber of trades of the moving average orsmoothing methods.
Percentage ofprofitable trades
Both moving average and smoothing decline, theslope method is erratic, and the N-day breakout isuniformly higher.
70
A SHORT COURSE IN TECHNICAL TRADING
Which is best? It’s the one with the highest ratio of returns to risk. The besttrading method is always the one that gives the largest return for the smallest amount of risk.
What You Need to RememberIdentifying the trend is the most important single element of technical analysis, no matter how you choose to use it. If you’re going to be profitable trading the trend, then any one of the four methods will work. The choice ofmethod should not turn a loss into a profit.The N-day breakout has the best overall characteristics although it hasthe higher risk on individual trades. The moving average method is the bestchoice if small losses are important to you