to generate trading signals.
12/20/95
12/6/95
11/22/95
11/8/95
10/25/95
9/27/95
10/11/95
Date
9/13/95
8/30/95
8/16/95
8/2/95
7/19/95
7/5/95
6/21/95
6/7/95
5/24/95
5/10/95
4/26/95
80
CHAPTER 3 Creating Trading Strategies
59
Moving Average Example75
65CloseMoving average55
31
29
27
25
23
21
19
17
15
13
11
9
7
5
3
1
45Day
FIGURE
3.2
Moving Average Example. The lag of a moving average allows traders to stay on board of trends.
example above, Figure 3.2, illustrates a 20-day simple moving average of a market that increases one point a day, then declines one point per day. As can be seen,the moving average always trails under prices on the way up and never catchesprices on the way down.While many traders curse this lag, I value it. The lag of moving averages iswhat enables profits to be made during trending periods. When prices trend awayfrom the moving average, trading signals are generated. As long as prices continuein the direction of the trend, the moving average will always lag current prices. Thelonger the trend, the more profitable the moving average strategy will be. In a market that oscillates in a cyclical sideways fashion, lag can be a problem. But morefrequently than not, no discernible cyclical action can be identified in marketprices, and we can use the moving average’s lag to climb aboard the predominanttrend of the market.The major drawbacks associated with moving average strategies are the whipsaws associated with choppy market action. If a market shows signs of strength,then prices will cross above the moving average and generate buy signals. Whenprices quickly reverse and fall below the moving average, longs will be sold with aloss and new short positions established.Figure 3.3 shows how whipsaws can eat into trading capital. As the market rallies and then declines with no discernible trends, the short-term trades
PART 1 Structural Foundations for Improving Technical Trading
60
Price and Five Day Average108PriceAverage104
100
10
9
8
7
6
5
4
3
2
1
0
96
Date
FIGURE
3.3
Price and Five Day Average. Whipsaws are created when prices frequently rise above and fall below moving averages.
lead to losses. We enter short on Day 2 at 103, close our short two days later at104 for a one point loss and establish a long position. Two days later we closeour long as the market declines, leading to another losing trade. Finally, on Day8, we enter long again. If markets are prone to short and violent moves withmany reversals along the way, moving average systems are likely to suffer.Using longer length moving averages can cut down on this whipsaw somewhat,but for the most part, whipsaws are an unfortunate part of moving average trading systems.Channel BreakoutsRichard Donchian, whom we briefly discussed in Chapter 1, was a pioneer in systematic futures trading. He is credited as the first to use channel breakouts in histrading. Channel breakouts derive their name from channels that are created whenplotting a running tally of the highest highs and lowest lows over a fixed intervalof days. A 20-day channel involves calculating and plotting the highest and lowestclose over the past 20 days. As new price highs or lows are made, the channelmoves higher and lower, contracting and expanding with market volatility (seeFigure 3.4).
CHAPTER 3 Creating Trading Strategies
61
Over the past few years, channel breakouts have overtaken the popularity ofmoving averages. This popularity is likely due to the wonderful stories of tradinglegend Richard Dennis and his “turtle” offspring.In the early 1980s, Richard Dennis and partner William Eckhardt debated if trading could be taught successfully. To settle the argument, they hired a group of novicetraders from varying backgrounds. The pair taught the basics of their trading systemand sent their pupils into the world to trade. In its simplest form, their system was akinto a channel breakout strategy originally introduced by Richard Donchian. Using thisbasic strategy, many of the turtles have become wonderfully successful public moneymanagers, managing billions of dollars with lucrative long-term track records.The channels are incorporated into a trading strategy. Entries are executedwhen prices penetrate the channel. A buy is taken when today’s close is greaterthan the previous x closes, and a sell is taken when today’s close is lower than theprevious x day’s closes. If a 40-day channel breakout strategy were employed, abuy signal would be generated every time the market’s close was the highest of thepast 40 days. Sell signals are generated when the market closes lower than anyother close of the past 40 days. The longer the channel length, the less frequentlythe strategy will trade.
Channel Breakout Example53.50Closing price20 day high20 day low
53.0052.5052.0051.5051.0050.5050.0049.5049.0048.50
81
77
73
69
65
61
57
53
49
45
41
37
33
29
25
21
17
13
9
5
1
48.00Day
FIGURE
3.4
Channel Breakout Example. Price channels are created by calculating the highest and lowest closes overa specified range.
PART 1 Structural Foundations for Improving Technical Trading
62
Channel Breakout Rules■
Buy if today’s close is the highest close of the past x days
■
Sell if today’s close is the lowest close of the past x days
Not only are moving averages and channel breakouts popular, but they havegenerated substantial profits by riding long-term trends over the past 20 years. Dueto this success, we will be spending much time with both trading methodologies.When evaluating performance of new trading strategies, we will always comparethe results of any new systems to the performance of two specific variations of themoving average and channel breakout trading methodologies. This topic will berevisited in Chapter 4, “Evaluating Trading Strategy Performance.”MomentumMomentum entries are perhaps the most simplistic techniques available to traderstoday. Momentum is calculated by taking a difference between one value andanother value at some point in time.Momentum = Valuetoday – Valuex days agoA typical example is price momentum (Figure 3.5). A 20-day momentum ofclosing prices would be calculated by taking the difference between today’s close
Momentum Example20.00
60.0055.00
15.00
50.00Closing Price
10.00
20 day Momentum
45.00
5.0040.000.00
35.00
–5.0081
71
61
51
41
31
21
11
1
30.00Day
FIGURE
3.5
Momentum Example. Momentum is calculated by taking a price change over a specified range.
CHAPTER 3 Creating Trading Strategies
63
and the close 20 days before. Perhaps the most versatile indicator of all, momentum can be applied to prices, moving averages, oscillators, and other indicators.Typically, a buy signal is generated when momentum turns positive, and a sell isgenerated when momentum turns negative.Momentum RulesBuy when today’s close is greater than the close x days ago■ Sell when today’s close is less than the close x days ago■
Volatility BreakoutsVolatility breakouts are also a popular type of entry, commonly found as the basisof short-term systems that trade the S&P 500 and Treasury bond futures.Developed in the mid 1970s by Larry Williams, the premise behind the strategy isthat large short-term price jumps tend to be precursors of further movement in thesame direction.There are a number of reasons why large price changes may be a signal tofurther movement in the same direction. First, trading costs are non-negligible,especially when committing large amounts of capital. When positive news breakson a stock, it might take time for large institutions to make a decision to purchaseshares. The transaction costs associated with buying or selling $100 million ofassets is very costly, not only in terms of commissions, but also the slippage thatis created from such large transaction sizes. Any institution willing to commit suchlarge amounts of capital had better be sure it is the correct trade, otherwise the costof reversing the trade could be enormous. This delay may allow the nimble quantitative trader to trade before the large institutions act. Another factor that canenhance the volatility breakout for traders is that all investors do not have equalinformation.Sanford Grossman and Joseph Stiglitz (1980) first suggested the idea ofinformation disequilibrium to explain the impossibility of truly efficient markets.Grossman and Stiglitz hypothesize that in every case, some investors have betterinformation than others. The theory is based upon the significant costs associatedwith performing research. Hiring analysts to visit companies and dig through SECfilings can be expensive. If investors who spend this money on fundamentalresearch cannot outperform uninformed investors, then the information gathererswill soon cease their research. As a result, markets will become inefficient untilcertain investors begin to do costly research again.Chances are, when the informed investors take positions, they move marketsto extremes due to their conviction. The volatility breakout strategy may be able totrack the movement of these informed investors, identify these extremes, andexploit their profit potential. Volatility breakouts look for large single-day pricemoves and trade in the direction of the move.
PART 1 Structural Foundations for Improving Technical Trading
64
The volatility breakout entry is comprised of three pieces: a referencevalue, a volatility measure, and a volatility multiplier. The reference value marksthe measurement price of the move. The volatility measure computes the typicalvolatility of the market to separate significant movement from random pricechanges. The volatility multiplier determines the sensitivity of price movementrequired to trigger entry signals. The three components are combined into a trigger point. Buy entries are executed when prices close above the upper trigger,while sales are triggered when prices close below the lower trigger.The reference value is the point from which we will measure the start of themove. This is typically measured using the previous day’s close, today’s opening,or a short-term moving average of closes. The three most common volatility measures are the standard deviation of price changes, the standard deviation of prices,and the average true range. The most logical volatility measure is to calculate astandard deviation of price returns. Remember, standard deviation measures thedispersion of returns and is a surrogate for market volatility. By calculating thestandard deviation of returns, we can effectively determine significant marketmoves from random price action.Another popular measure of volatility is to calculate the average true range.The true range is the largest of the following values:Today’s high minus today’s low■ Today’s high minus yesterday’s close■ Yesterday’s close minus today’s low■
By averaging the true range over a set number of days, we can calculate apopular measure of market volatility called the average true range (ATR). The useof the previous day’s close in some situations is to account for price gaps that mayconstitute the bulk of any day’s volatility. If lumber, a futures market notorious forits trading halts due to daily price limits, opened limit-up and never traded lowerduring the day, the high-minus-low range would be zero. If this limit move continued for five days in a row, then taking a simple average of the high-to-low rangewould underestimate the true volatility of the market. By adjusting the high to lowrange for movement from the previous day’s close, we create a more robust measure of volatility.A third measure often used to calculate volatility is the standard deviation ofmarket prices. Unlike the standard deviation of returns, this method does not allowstrict interpretation using the normal distribution. It is nevertheless an effectivemeasure of the volatility of prices. Despite the myriad methods to calculate market volatility, as we see in Figure 3.6, each dispersion calculation method yieldsreasonably similar values.Volatility breakout entry points are derived by multiplying the volatility multiplier by the volatility measure and adding that value to the reference value.
CHAPTER 3 Creating Trading Strategies
65
Methods of Dispersion80.00STDEV of pricesAverage true rangeSTDEV of price changes
70.0060.00
Points
50.0040.0030.0020.00
FIGURE
12/24/01
12/10/01
11/26/01
11/12/01
10/29/01
10/1/01
10/15/01
9/17/01
9/3/01
8/6/01
Date
8/20/01
7/9/01
7/23/01
6/25/01
6/11/01
5/28/01
5/14/01
4/30/01
4/2/01
4/16/01
3/19/01
0.00
3/5/01
10.00
3.6
Methods of Dispersion. Calculating the standard deviation of prices, the standard deviation of pricechanges, and the average true range lead to very similar values.
Volatility Breakout RulesUpper trigger = Reference Value (yesterday’s close, today’s open, short-termmoving average) plus the Volatility Multiplier times Volatility Measure (standard deviation of price returns, average true range, standard deviation ofprice). Buy when today’s close is greater than the upper trigger.■ Lower trigger = Reference Value (yesterday’s close, today’s open, short-termmoving average) plus the Volatility Multiplier times Volatility Measure (standard deviation of price returns, average true range, standard deviation ofprice). Sell when today’s close is less than the lower trigger■
For example, we could use yesterday’s close as a reference value, thenumber one would be a volatility multiplier and a 10-day average true rangecalculation for a volatility measure. In this volatility breakout system, wewould buy if today’s close were greater than yesterday’s close plus one timesthe average true range of the past 10 days. Conversely, if today’s close wereless than yesterday’s close minus one times the average true range of the past10 days, then we would sell the market.
66
PART 1 Structural Foundations for Improving Technical Trading
Price OscillatorsAside from the trend-following techniques mentioned above, there are numerousmethods to define when a trend has become overextended or exhausted. These signals fall under a class of techniques called oscillators. The majority of oscillatorsuse range statistics to explain where current prices are located within the recentrange and attempt to generate sell signals when prices have risen too high and buysignals when prices are too low. Popular oscillators include the Relative StrengthIndex (RSI), %K stochastics, and Moving Average Convergence/Divergence(MACD). The premise behind standard oscillators is that once prices move to levels far from average, a reversal is eminent.Relative Strength IndexIntroduced by Welles Wilder in the 1978 classic New Concepts in TechnicalTrading Systems, the Relative Strength Index is perhaps the most popular overbought/oversold indicator used in the world today.According to Wilder, market tops are often completed when the indicator risesabove 70, while bottoms are formed during periods when the indicator falls below 30.Today, most practitioners prepare to buy the market on dips below 30, using a riseback above 30 on the indicator as a signal to buy. Conversely, traders will prepare tosell a market when the indicator moves above 70, entering on a cross below 70. TheRSI sums the price changes of up days and compares them with price changes ondown days to calculate the RSI value. (See Figure 3.7 for an example of the RSI.)100RSI = 100 ⫺ ᎏᎏU1 ⫹ ᎏᎏDwhere U is the average of all up moves and D is the average of all down movesStochasticsThe stochastic indicator is another oscillator very popular with traders.Popularized by George Lane during the late 1970s and early 1980s, it comparescurrent prices to the high and low range over a look-back period.Today’s Close ⫺ Lowest LowRaw %K Stochastics = ᎏᎏᎏᎏHighest High ⫺ Lowest LowThe raw stochastic indicator is usually smoothed using a three-day movingaverage to form the fast %K stochastic. The fast %K stochastic is smoothed onceagain using another three-day moving average to form the fast %D stochastic.Long positions are typically taken when the fast %K stochastic rises above 30 andaccompanied by a cross above the fast %D stochastic. Short positions are typically taken when the fast %K stochastic falls below 80 and is accompanied by a crossbelow the fast %D stochastic (see Figure 3.8).
CHAPTER 3 Creating Trading Strategies
67
Relative Strength Index1100
200175
1000
150Last price
125
14 day RSI800
100
RSI
Last
900
75
700
50600
25
75
50
25
00
500Day
FIGURE
3.7
Relative Strength Index. The Relative Strength Index (RSI) rises and falls between 0 and 100.
200
1030
180
1010
160
990
140
970
120
950
100
Slow %D
Slow %K
60
890
40
870
20
850
0
FIGURE
Day
3.8
Stochastic Oscillator. The stochastic oscillator rises and falls between 0 and 100.
90
910
60
80
30
930
0
Last
Stochastic Oscillator1050
PART 1 Structural Foundations for Improving Technical Trading
68
Moving Average Convergence/DivergenceThe Moving Average Convergence/Divergence (Figure 3.9), developed by GeraldAppel during the 1980s, is an oscillator created by taking the difference betweentwo exponential averages (a 12-day exponentially weighted average with ␣ = 0.15,and a 26-day exponential moving average with ␣ = 0.075). As the market rallies,the 12-day average will rise faster than the 26-day average, leading to increasingvalues of the MACD line. Declining markets will lead to declining values of theMACD, as the 12-day average will fall faster than the 26-day average.An exponential moving average of the MACD (often referred to as the signal line) generates buy and sell signals from crossovers. As the MACD rallies,stalls, and then crosses below its signal line, it indicates that the trend is exhausted and short positions should be entered. Conversely, if the MACD falls, tradesflat, and then rallies above the signal line, it indicates that the market is oversoldand long positions should be entered.MACD = 12-day EMA of close – 26-day EMA of closeMACD Signal = 9-day EMA of MACDThe RSI, stochastics, and MACD are just a smattering of the many oscillators usedto determine price exhaustion. Analyst Tom DeMark is a proponent of oscillatorsand has an interesting theory on their usefulness in identifying price exhaustion
Moving Average Convergence/Divergence100
1400
80
12001000
40
800
20
Signal line (thick)600
0
400
–20–40
200
MACD (thin)9/10/2002
8/26/2002
8/12/2002
7/29/2002
7/15/2002
6/28/2002
6/14/2002
5/31/2002
5/2/2002
5/16/2002
4/4/2002
4/18/2002
3/6/2002
3/20/2002
2/5/2002
2/20/2002
1/7/2002
1/22/2002
12/6/2001
12/20/2001
11/7/2001
11/21/2001
010/24/2001
–60
Date
FIGURE
3.9
Moving Average Convergence/Divergence. The MACD and its signal line generate trading signals.
Close
MACD Values
60
CHAPTER 3 Creating Trading Strategies
69
points. DeMark hypothesizes that uptrends continue until the last buyer hasbought, and downtrends continue until the last seller has sold. At this point ofexhaustion, prices must reverse due to a lack of further buyers or sellers. Usingoscillators can help pinpoint these points of trend reversal.One technique DeMark uses for generating trading signals is to only take signalsif oscillators spend a short period of time in overbought or oversold territory. If pricesrise and the 14-day RSI climbs above 65 and remains overbought for many days, thenthe market may be showing its underlying strength. Shorting such a strong market maynot be prudent. On the other hand, if prices rise and then fall, with the RSI only remaining above 65 for a period of five days or less before declining and falling below 65,then the market has shown its weakness and short positions should be taken.Price PatternsPrice pattern entries are the most difficult to define because they can encompassjust about anything to generate trading signals. Some price patterns signal trendcontinuation, while others signal potential market reversals. Patterns can be composed of one or more days of price action.One popular pattern, a key reversal day, indicates that the market may beturning. A key reversal sell signal is generated when today’s high is greater thanyesterday’s high and today’s close is lower than yesterday’s close. A key reversalbuy is generated when today’s low is less than yesterday’s low and today’s close ishigher than yesterday’s close (see Figure 3.10).Other patterns can include a reference to the day of week, in addition to a relationship between today’s and previous days’ opens, highs, lows, and closes. One ofLarry Williams’s patterns correctly forecasted the rally of April 17, 2001. The pattern includes two days of setups, with the trade made on the third day.To enter the S&P 500 long, the close on Day one must be higher than theopen. Day two must be Monday, Thursday, or Friday; the high must be lower thanthe high of the day before; and the low must be higher than the low of the daybefore. If on Day three the open is less than the high of Day three, then buy themarket if prices rise above the high of Day one. While this price pattern is a bitmore complex than most, do not be afraid to let your imagination run wild whencreating your own pattern trading signals.
TRADING STRATEGY EXITSRarely do exits receive the attention they deserve within a complete trading system. In terms of creating a profitable system, they are responsible for convertingthe edge of entries into closed trade profits. While entries are responsible for creating profitable trades, we need signals to determine when to exit both profitableand unprofitable trades.
PART 1 Structural Foundations for Improving Technical Trading
70
Key ReversalsKey Reversal Top
Key Reversal Bottom
991/1/00
FIGURE
1/2/00
1/3/00
1/4/00
1/5/00
3.10
Key Reversals. Key reversals are one popular chart pattern that generates trading signals.
Typically, signals that close profitable trades are referred to as “exits,” whilesignals that close unprofitable trades are called “stops” or “stop loss signals.”Readers should note that I lump exits and stops together into the same category.That’s because I believe they serve the same purpose: to maximize profits andminimize losses. A few popular exits include profit targets, trailing stops, andfixed value stop losses.Profit TargetsProfit targets close profitable trades. They are usually calculated using a range statistic such as standard deviation of prices, standard deviation of closes, or average truerange. For example, after buying IBM at $100, we might place a sell exit at three timesthe average true range of the past 20 days above the entry price of $100 to capture profits. If the average true range is $2, then we would sell IBM at $100 + (3)($2) = $106.Trailing ExitsIf our entry is immediately profitable, it’s likely that the significant profits we generate will be at risk if the market turns. We might then give away all our profitsand turn a winning trade into a losing one.
CHAPTER 3 Creating Trading Strategies
71
Trailing stops can lock in profits after trades start to turn against us.There are a number of methods to accomplish this task. For example, we canexit long positions when the market makes a five-day low. In this case, we areadapting the channel breakout entry into an exit. Also, we can exit long positions when the market closes below the previous pivot point low (see Figure3.11). Pivot point lows are created when one day’s low is lower than both theprevious and following day’s low. Pivots can be expanding to require multipledays, such that today’s low must be lower than both the three days before andthree days after.Another example of a trailing exit is by following the best position profit. Inthis case, we might exit our trade when the market reversed a set amount from themaximum profit achieved in the trade (see Figure 3.12). The reversal amount canbe based on the usual range statistics, such as standard deviation of prices, standard deviation of closes, or an average true range calculation.For example, we might exit if prices fell three times the average true rangeof the past 20 days below the highest close while we were long. As long as pricesrise while we are long, so too will our trailing stop. Once prices reverse, our trailing stop will become fixed (only changing based on the value of the true range),and if prices fall enough and decline below our stop level, we will exit the longposition.
Pivot Point Low105
951/1/00
FIGURE
1/2/00
1/3/00
3.11
Pivot Point Low. A pivot point low is generated if the low immediately prior and the low immediately afterare higher than the middle day’s low.
PART 1 Structural Foundations for Improving Technical Trading
72
Pivot Point High105
1001/1/00
FIGURE
1/2/00
1/3/00
3.12
Pivot Point High. A pivot point high is generated if the high immediately prior and the high immediatelyafter are lower than the middle day’s high.
Fail-Safe ExitsLosing is a part of all trading. In the unfortunate event that we are unable to sellat our profit target and our trailing stops are not activated, we may need a fail-safemethod of exiting unprofitable trades. We can place a sell order when the tradegoes against us by an amount equal to two times the average true range of the past20 days. If we buy IBM at 100 and the average true range is $1.50, we would sellif IBM fell below $97=(100 – 2 ⭈ 1.50) to minimize our losses and accept that ourentry did not work.Trading Strategy FiltersWhile entries and exits get us in and out of the market, there are better times thanothers to be trading the market. We use filters to determine those times when weshould be on the sidelines and ignoring our entry signals. Filters either give thegreen light to trade or a red light that overrides buy and sell signals.For example, we might use a trend filter to avoid trading during periods ofconsolidating markets. We might only take entry signals if the trend filter indicatesthe market is in trend mode. Popular trend filters include the Average DirectionalMovement Index (ADX) and the Vertical Horizontal Filter (VHF). Both measurethe strength of a trend. A typical use of a filter is to only take signals when valuesof these filters are greater than some threshold.
CHAPTER 3 Creating Trading Strategies
73
CREATING NEW STRATEGIESWhen creating new strategies, it’s best to start with a trading premise and thenmold this theory into concrete trading rules. A typical progression from theory totrading rule follows:Theory. Large moves are a result of new information entering the markets.This information may not be immediately digested by all market participants.■ Trading rule. Buy when today’s price change is greater than two standarddeviations of the 20-day standard deviation of price changes.■
In the above example, we follow the process of formulating a theory, creatingan experiment, and drawing conclusions. This scientific method is tremendouslyimportant to the development of trading strategy. Using logic to create tradingmethods helps to avoid the process of curve-fitting data to achieve a desired result,otherwise known as data mining. As we will see later, the pitfall of data mining isthe need to overexplain market prices.Traders are sometimes unsatisfied with profitable trading systems. Instead, theyoften feel the need to constantly improve strategies by adding complex rules toexplain a larger proportion of price movement and thereby increase profitability. Inthe end, these models often break down in real-time trading due to the extra levels ofunwarranted complexity. Throughout this book, we will diligently follow the scientific process of using logic to create, test, and then implement new trading strategies.The Need for Trading Systems and PlansIn college, I began trading futures with two friends of mine. We opened an accountwith $3500 (mostly of student loan money) and began to trade multiple futuresmarkets actively. Instead of using tested trading strategies similar to those in thischapter, we blindly chose to buy and sell contracts based on gut feel from pricecharts and tape reading. This lack of a trading plan hurt in many ways. Not onlydid we have no confidence that our ideas would be profitable, but we were not prepared for the day-to-day lifestyle associated with trading.I remember one morning we were trading coffee futures the day of a financefinal exam. With the exam stretching the opening of the coffee market, we recruited another dorm mate for trading and wrote detailed instructions to place ourorders. The paper looked something like this:1. At 9:45 call 1-800-xxx-xxxx.2. Ask for the quote on July coffee.3. If July coffee is above 155, say, “Buy 1 July coffee at 156 on a stop foraccount 1234.”4. If July coffee is below 153, say, “Sell 1 July coffee at 152 on a stop foraccount 1234.”
74
PART 1 Structural Foundations for Improving Technical