factors such asindustry concentration, or concentration of small cap or large cap stocks. Theportfolio was reselected each month and new stocks were chosen for both longand short portfolios.The results: The average outperformance by buying losers and shorting winners was 1.09 percent per month, a strategy that produced profits in 43 out of 46months. These results suggested that the market is not efficient and that activeinvestors could indeed outperform the market.In another study, Louis Lukac, Wade Brorsen, and Scott Irwin (1990) studiedthe performance of 12 technical trading systems on 12 commodity futures between1975 and 1984. The trading rules were taken straight from popular trading literature, with all but a handful of methods best described as “trend-following” innature. The nine methods of examination included the channel breakout, parabolicstop and reverse, directional indicator system, range quotient system, long/short/outchannel breakout, MII price channel, directional movement system, reference deviation system, simple moving average, dual moving average crossover, directionalparabolic system, and Alexander’s filter rule.The results: 7 of the 12 strategies generated positive returns, with four generating profits significantly greater than zero using very strict statistical tests.Usually, data from non-natural sciences does not pass statistical tests of significance. The fact that Lukac, Brorsen, and Irwin were able to find trading resultsthat pass these stringent tests is remarkable. Of these four strategies, averagemonthly returns ran from +1.89 to +2.78 percent, with monthly standard deviations of 12.62 to 16.04 percent. Two of the profitable systems were the channelbreakout and dual moving average crossover. They will be the base of comparisonfor new trading models we develop later in the book.And in still another study, Andrew Lo, Harry Mamaysky, and Jiang Wang(2000) attempted to quantify several popular trading patterns and their predictive power on stock prices. After smoothing prices, the three quantified 10price patterns based on quantified rules. These patterns, shown in Figures 1.3through 1.12, have long been a fixture in technical trading since they were firstintroduced by Edwards and Magee in 1948. The names correspond to the similarity of the patterns to various geometric shapes and their resemblance to reallife objects.
PART 1 Structural Foundations for Improving Technical Trading
16
Head and Shoulders Top115
110
105
100
29
31
33
35
37
39
41
29
31
33
35
37
39
41
27
25
23
21
19
17
15
13
9
11
7
5
3
1
95
Date
FIGURE
1.3
Head and Shoulders Top.
Head and Shoulders Bottom105
100
95
90
Date
FIGURE
1.4
Head and Shoulders Bottom.
27
25
23
21
19
17
15
13
9
11
7
5
3
1
85
CHAPTER 1 Introduction to Quantitative Trading
17
Triangle Top115
110
105
100
34
37
40
43
46
49
34
37
40
43
46
49
31
28
25
22
19
16
13
10
7
4
1
95
DateFIGURE
1.5
Triangle Top.
Triangle Bottom105
100
95
90
DateFIGURE
1.6
Triangle Bottom.
31
28
25
22
19
16
13
10
7
4
1
85
PART 1 Structural Foundations for Improving Technical Trading
18
Double Top115
110
105
100
25
27
29
31
33
35
37
39
41
25
27
29
31
33
35
37
39
41
23
21
19
17
15
13
11
9
7
5
3
1
95
DateFIGURE
1.7
Double Top.
Double Bottom105
100
95
90
Date
FIGURE
1.8
Double Bottom.
23
21
19
17
15
13
11
9
7
5
3
1
85
CHAPTER 1 Introduction to Quantitative Trading
19
Rectangle Top115
110
105
100
95
45
49
53
57
61
65
69
45
49
53
57
61
65
69
41
37
33
29
25
21
17
13
9
5
1
90
Date
FIGURE
1.9
Rectangle Top.
Rectangle Bottom1151101051009590
Date
FIGURE
1.10
Rectangle Bottom.
41
37
33
29
25
21
17
13
9
5
1
85
PART 1 Structural Foundations for Improving Technical Trading
20
Broadening Top1151101051009590
40
43
46
49
52
55
58
40
43
46
49
52
55
58
37
34
31
28
25
22
19
16
13
10
7
4
1
85
Date
FIGURE
1.11
Broadening Top.
Broadening Bottom110
105
100
95
90
Date
FIGURE
1.12
Broadening Bottom.
37
34
31
28
25
22
19
16
13
10
7
4
1
85
CHAPTER 1 Introduction to Quantitative Trading
21
While technical traders have relied on these patterns for years, only recentlyhave academics attempted to quantify the attributes of these formations. Oncewe systematically identify the appearance of these patterns, we can explore theprofitability of trading signals that these patterns generate. Curtis Arnold andThomas Bulowski have done excellent work in this field over the past decade.Curtis Arnold’s PPS Trading System was one of the first works to systematicallydefine trading patterns and test trading rule validity when these patternsoccurred. Whereas interpreting charts was very much an art, Arnold definedeach pattern and systematically tested trading rules to buy and sell based onwhen these patterns occurred. Thomas Bulowski has taken this research evenfurther with his books Encyclopedia of Chart Patterns and Trading ClassicChart Patterns.At any rate, Lo, Mamaysky, and Wang tested the 10 patterns mentionedabove on NYSE, Amex, and Nasdaq stocks between 1962 and 1996. In addition,the researchers generated numerous paths of random price movement akin to theBrownian motion discussed earlier. The same rules were used to detect patterns onthe random data. If market prices are truly random and follow Brownian motion(or drunkard’s walk, if you prefer), then two similarities in the data should emerge:1. The occurrence of each of the 10 patterns on actual stock data shouldroughly match the occurrence of patterns on the randomly generated data.2. Returns from trading signals associated with specific patterns on the actualstock data should not be different from zero.If we can make money trading these patterns, then we have reasons to believethat markets are not efficient. Surprisingly, Lo and company found that severalpatterns, such as head shoulder tops and bottoms, occurred with much greater frequency in actual price data than did in the randomly generated price series. Inaddition to the increased frequency of some patterns, returns following certain patterns’ presence were also significant—specifically, declines following the headand shoulders top, and rallies that followed the head and shoulders bottom.
BIRTH OF A NEW DISCIPLINEThe results seen in the above-mentioned studies have led to researchers to investigate the reasons why some market inefficiencies can withstand over time. Themost popular theories study patterns in human behavior. The tendency of individuals to move as a crowd and create market bubbles led to new thinking about howmarkets operate. Focus began to turn to the behavior of individuals and whetherthis behavior, predictable or not, leads to panics and manias in the markets. Thisnew branch of finance studies psychology and sociology as it applies to financialmarkets and financial decisions.
22
PART 1 Structural Foundations for Improving Technical Trading
Behavioral Finance and the Flaw of Human NatureBehavioral finance, as it is now known, has attracted some of the top minds in academic finance. It is a combination of classical economics and the principles of behavioralpsychology. This new science has been used as a vehicle to study potential causes of market anomalies and inefficiencies that inexplicably seem to repeat over time. By studyinghow investors systematically make errors in their decision-making process, academicscan explain and traders can exploit the psychological aspect of investing.Many ideas of behavioral finance were spawned by the work of AmosTversky and Daniel Kahneman, psychologists who studied how people madechoices regarding economic benefit. Among the most popular of Kahneman andTversky’s discoveries were prospect theory and framing. Prospect theory, as wewill see later in this chapter, deals with the fact that individuals are reluctant torealize losses and quick to realize gains. Framing deals with how answers can beinfluenced by the manner in which a question is posed. One example of framingfrom a 1984 study by Kahneman and Tverksy illustrates this point. The pair askeda representative sample of physicians the following two questions:Imagine that the United States is preparing for the outbreak of an unusualAsian disease, which is expected to kill 600 people. Two alternative programs to combat the disease have been proposed. Assume that the exactscientific estimates of the consequences of the program are as follows: Ifprogram A is adopted, 200 people will be saved. If program B is adopted,there is a one-third probability that 600 will be saved and a two-thirdsprobability that no people will be saved.Which of the two programs would you favor?Imagine that the U.S. is preparing for the outbreak of an unusual Asian disease, which is expected to kill 600 people. Two alternative programs tocombat the disease have been proposed. Assume that the exact scientificestimates of the consequences of the program are as follows: If programC is adopted, 400 people will die. If program D is adopted, there is a onethird probability that nobody will die and a two-thirds probability that 600people will die.Which of the two programs would you favor?
Both these questions present the exact same scenario. In programs A and C,200 people would live and 400 people would die. In programs B and D, there is aone-third probability that everyone would live and a two-thirds probability thateveryone would die. Programs A and C lead to exactly the same outcome, as doprograms B and D. The only difference between the first and second question is inframing. The first question is positively framed, viewing the dilemma in terms oflives saved. The second question is framed negatively, the results measured in liveslost. This framing affects how the question is answered.Kahneman and Tversky discovered that while 72 percent of the physicianschose the safe and sure strategy A in the first question, 72 percent voted for the
CHAPTER 1 Introduction to Quantitative Trading
23
risky strategy D in the second question. This is illogical, as anyone who picks strategy A should also pick strategy C, since the stated outcome in both cases are exactlythe same. The experiment shows that how we frame questions can influence theresponses we receive.Much of Kahneman and Tversky’s work displays a tendency for people tomake inconsistent decisions when it comes to economic decisions. Other economists have taken the pair’s work and applied its value to the question of marketefficiency. This brings up the logical question: If individuals make inconsistentdecisions, can this lead to inefficient financial markets due to irrationality?Irrational Decision MakersWhile most people believe that all investors must act “rationally” for a market to beefficient, this is not accurate. Buyers will buy to the point of their perceived fairvalue, and sellers will sell down to the point of their perceived fair value. The priceat which an equal number of buyers and sellers meet is the clearing market price.When positive information is released, investors rationally bid a stock higher on therevised fair value of business prospects. Even if a handful of investors and tradersact irrationally by buying and selling based on irrelevant information (such as moonphases or what their pets bark), the market should still be priced efficiently.Chances are that if one irrational investor is buying, then another is selling.Market efficiency runs into trouble when the actions of irrational investorsdo not cancel out. Consider the situation where irrational investors all pile on andbuy the market at the same time or they all run for the exits at the same time. If allthe irrational investors buy or sell together, they can overwhelm the rationalinvestors and cause market inefficiencies.Let’s take, as an example, XYZ Inc., and say it’s trading at $100, with 100investors following it. The 80 rational investors have decided $100 is the fair valueof the company based on future business prospects. The other 20 buy and sell basedon irrelevant information. As XYZ’s revenues increase, rational investors bid thestock up to $120—buyers are willing to pay the higher price based on improvedbusiness prospects. Now the 20 irrational investors, all momentum players, begin tobuy the stock due to its performance, driving the stock up to $135. They buy fromrational people who are willing to sell their stock above their perceived fair value.Ten of the rational investors, who either believe they’re misinterpreting the information or who feeling pain because they are not long in XYZ, become irrational andalso buy the stock, driving it up to $145. This process can spiral out of controland create a positive feedback loop, causing unbelievable valuations. All this startedwith 20 irrational investors and a small amount of positive news in XYZ Inc.When irrational investors move together, market irrationality can exist andtake hold for quite some time, eventually leading to bubbles, panics, and crashes.This theory might explain the technology boom and bust of the late 1990s andearly 2000s. As public investors and day traders craved technology stock exposure,their thought process shifted from rational methods of valuation to the irrational
24
PART 1 Structural Foundations for Improving Technical Trading
belief that valuation was not important. Like many, I saw my peers making a lot ofmoney in the market and felt compelled to get on board and not be left behind. Mybuying the market had nothing to do with fair valuation or expected businessprospects of the companies I bought. Instead, it was motivated by fear of being theonly one not getting rich in the market. Similar herd mentality was also presentduring panics in 1987, 1989, and 1997. Afraid that they would be left holding thebag when the market made a low, otherwise rational investors can become irrational. As a result, they sell investments to raise cash, either hoping to miss someof the decline or, at the very least, to outperform their peers.An article originally published in the Journal of Finance is credited withbeginning the behavioral finance revolution. In 1986, Werner DeBondt andRichard Thaler studied the return differences of the best and worst performingstocks from 1926 through 1982. Stocks with the best three year returns wereassembled into a portfolio of winners, and those with the worst three yearreturns were gathered into a portfolio of losers. DeBondt and Thaler noticedthat over one to five years after the portfolios were created, those that containedpreviously underperforming stocks significantly outperformed portfolios ofpreviously outperforming stocks by between 4 and 6 percent per year. This outperformance occurred whether a narrow (35) or a broader number of stocks(80+) were chosen for each portfolio. They concluded that investors overreactto unexpected news events, placing too much emphasis on recent news andearnings.Investors begin to expect companies that have consistently beat earnings estimates to continue to do so in the future. Then, at some point business prospectsslow, the company only meets or even misses estimates, and investors run for theexit in the stock. Similarly, companies that continually perform worse than expected are labeled as “terrible” and with no turnaround potential. Eventually, theirbusiness prospects also recover, and investors run to buy the stock. This short-termthinking among investors can create market inefficiencies.Robert Shiller of Yale University might be the most widely known behavioral economist. Shiller’s ground-breaking work on market volatility in the 1980sredefined how economists look at the stock market. In 1981 he suggested thatmarket prices were as much as 5 to 13 times too volatile based on their drivers ofvalue: cashflow. While stock prices should move proportionally to changes in acompany’s expected cashflow (cashflows will eventually be passed on toinvestors via dividends), Shiller found that stock prices were more volatile thanwhat would be predicted by the volatility in underlying dividends. He hypothesized that the excess volatility could be attributed to investors’ psychologicalbehavior and the fact that investors overreact to both positive and negative news.Although some have criticized Shiller’s methods (Schwert, 1991), his argumentshave set off a new wave of thinking about the effect of investor psychology on themovement of prices.
CHAPTER 1 Introduction to Quantitative Trading
25
Despite the academic research suggesting that inefficiencies do exist infinancial markets, many people question the profitability of quantitative trading.You might ask: Why should fixed rules generating buy and sell signals ever besuperior to human discretion and the ability to evaluate problems on a situationby-situation basis? (Indeed, they appear to, as seen in the results cited earlier in thechapter showing that systematic money managers have outperformed their discretionary counterparts.) The answer is: Human discretion has a habit of sabotagingperformance. Over the past decade, psychological and financial research havecome together to explain the nature of such emotional tendencies and to shed lighton why some market patterns continue to exist over the years.Selling Winners and Holding LosersStudies of human bias in economic situations shed light on how the mind affectstrading decisions. In one such study conducted in 1998, Terrance Odean, professor of finance at the University of California, examined 10,000 accounts at a largediscount brokerage firm to determine if individuals’ trading styles differedbetween winning trades and losing trades made from 1987 and 1993. He found asignificant tendency for investors to sell winning stocks too early and hold losingstocks too long. Over his test period, investors sold approximately 50 percent moreof paper profits on winning trades than they sold of paper losses in losing trades.Based on the data, Odean concluded that winning stocks were sold quickerand more frequently than losing stocks. Although the results were a bit surprising,this behavior by investors could make sense. When we buy stocks, we’re placing abet that a company is undervalued. Stocks that increase in value are logicallybecoming less undervalued as they rise, while stocks that decrease in value arelogically becoming more undervalued. Winning stocks that have increased in valuecould be considered not as cheap as when they were purchased. Losing stocks thathave declined in value could be considered cheaper than when purchased. In thiscase, it makes sense to sell the winning stocks that have become less cheap andhold losing stocks that have become cheaper.Although the logic is sound, Odean’s results show that the opposite actuallyoccurs. Winning stocks that were sold continued to rise, while losing stocks thatwere held continued to fall in value. In the year following sales, stocks sold withgains by individual investors outperformed the market by an average 2.35 percent.At the same time, losing stocks that were held underperformed the market by anaverage of 1.06 percent. Odean discovered, on average, that investors underperformthe market by selling their winners too early and holding on to their losers too long.Based on purely economic terms, it’s unclear why they behaved in this manner; psychology may provide the missing link. Clearly, the more profitable course of actionsuggested by the study is to buy winning stocks and sell losing ones.Two theoretical underpinnings dominate the tendency to sell winners andride losers: prospect theory and mean reversion theory.
26
PART 1 Structural Foundations for Improving Technical Trading
Prospect Theory. Prospect theory adapts psychologists’ Daniel Kahneman andAmos Tversky’s theories to financial markets. It suggests that investors are morerisk averse when dealing with profitable investments and more risk seeking ininvestments with losses. We all enjoy winning and take pain in losing. As a result,investors and traders take winners very quickly (to placate our psyche) and holdon to losers (to hold on to hope that the losers may eventually become winners).To demonstrate, give people the following choice:Game 175 percent chance of making $100025 percent chance of making $0or100 percent chance of making $750
We can calculate the expected value of each game by summing the productof each outcome’s probability by its payout:Expected payout of risky choice = 75% ⭈ $1000 + 25% ⭈ $0 = $750While the expected value of both options is the same in Game 1, individualstend to be very risk averse with gains. Most people will take the certain $750 ratherthan take the risk for a higher payout. Now consider Game 2, which presents theexact same choice, only among losses:Game 275 percent chance of losing $100025 percent chance of losing $0or100 percent chance of losing $750Expected payout of risky choice = 75% ⭈ –$1000 + 25% ⭈ $0 = –$750
In Game 2, most people will choose to risk the chance to come out even andtake the first option. While both options have the same expected value, the possibility of coming out without a loss is often too much to pass up. Basically, the tendencies revealed in both games show that individuals are risk averse with theirwinnings and risk seeking with their losses.This, of course, jibes with Terrence Odean’s research. From practicalexperience, I can add that I’ve often caught myself holding on to losing tradeswhile thinking, “If I can only get out even on this trade,” or taking it so far asto calculate breakeven points in hopes of avoiding the disappointment of closing out a losing trade. If prospect theory is alive and well in the financial markets, we may be able to take advantage of human nature by designing tradingstrategies that are not susceptible to the inconsistent thinking embedded inhuman nature.
CHAPTER 1 Introduction to Quantitative Trading
27
Ten Year Note Yields109
Yield (%)
8765
1/5/02
1/5/01
1/5/00
1/5/99
1/5/98
1/5/97
1/5/96
1/5/95
1/5/94
1/5/93
1/5/92
1/5/91
1/5/90
4
DateFIGURE
1.13
Ten Year Note Yields. Yields tend to mean revert between 5% and 8% during the 1990s.
Mean Reversion Theory. The second theory explaining why investors sell winners and hold losers is that investors buy and sell stocks as if they expect meanreversion in prices. Mean reversion occurs when a series of numbers eventuallyreverts back to a long-term average. A good example is interest rates. As measuredby the yield on the 10-year Treasury bond, interest rates have traded in a rangemostly between 5 and 8 percent over the past 10 years (see Figure 1.13).More often than not, when interest rates are low, they are met by supply fromissuers looking to borrow money. This leads to an increase in rates. Conversely,when rates are high, they are met by demand from investors looking to lock in theabnormally high interest rates. This causes interest rates to decline to more normallevels. If investors believe that stock prices move in a similar path, they will bewilling to sell stocks that rally and hold stocks that decline—believing that eachwill eventually return to its more normal level.For example, consider stock XYZ, as seen in Figure 1.14. It trades between $50and $55 for many months before breaking below this range to $45. When looking atthe graph of the stock, the mean reversion associated with human nature would leadus to believe that the move was abnormal and that it should be bought. A similarexample is stock ABC in Figure 1.15. When ABC breaks above $50 per share afteralso trading between $45 and $50, we might believe that the stock should be sold onthe basis that it too will reenter its previously established $45 to $50 range again.
PART 1 Structural Foundations for Improving Technical Trading
28
Price Chart of XYZ585654
Share Price
525048Investors buy on belief XYZ will re-enter $50-55 range464442
FIGURE
86
81
76
71
66
61
56
51
46
41
36
31
26
21
16
11
6
1
40
1.14
Price Chart of XYZ. Investors will buy XYZ on a break below $50, expecting a return to the $50-$55range.
Paul Andreassen, a Harvard psychologist, conducted two experiments inthe mid-1980s to determine if people traded based on mean reversion (1988).Andreassen gave test subjects an arbitrary amount of money in a fictitious brokerage account. Randomly generated stock prices were shown to the subjectsevery 30 seconds over 120 total trials. At the end of each trial, subjects wereallowed to buy or sell stock, subject to the amount of money in their experimental account. Each subject’s compensation for their role in the experimentwas determined by how well they traded, so each had economic incentive to perform optimally.Andreassen found evidence that the test subjects more often boughtstocks on declining days and sold stocks on days in which prices rose. Onestrong explanation of this behavior is that human nature assumes that priceswill mean revert. When presented with a series of stock prices, it is humannature to expect that prices will return to their most recent equilibrium level.This belief contrasts with the more traditional theory that market prices areindependent and follow a random walk where prices may move up or downwith equal likelihood.There are a number of quantitative techniques we can utilize to take advantage of investors’ tendencies to sell winners too early and hold losers too long.Most of these models fall under the class of trend-following systems. Trend fol-
CHAPTER 1 Introduction to Quantitative Trading
29
Price Chart of ABC5654Investors sell on belief that ABC will re-enter $45-50 range
Share Price
525048464442
FIGURE
86
81
76
71
66
61
56
51
46
41
36
31
26
21
16
11
6
1
40
1.15
Price Chart of ABC. Investors will sell ABC on a rise above $50, expecting a return to the $45-$50 range.
lowing strategies buy strong markets and sell weak markets. We may be able toexplain the success of these trend-following strategies using a combination ofprospect theory and mean reversion theory.
Trend-Following Systems. When prices rise above recent ranges, prospect theorydictates that traders with long positions will exit trades while traders losing moneyon short positions will hold their trades. Traders who are long will be risk aversewith their gains and will sell long positions in order to lock in gains and feel mentally rewarded. At the same time, traders who are short will be reluctant to closetheir short positions with losses. They hope the market will turn so they might exitwithout loss.In addition, as the market rises above the old trading range, mean reversionthinking will suggest that the market has overextended itself on the rally and willeventually return to its previous trading range. Traders whose minds detect the meanreverting process will establish short positions due to a belief that prices will returnto their norm. Of course, traders selling the breakout are eventually doomed. Newinformation has hit the market and prices are destined to head higher. Those whofight the trend will lose, while traders who trade with the breakout will feast on thenatural human tendencies of those market participants unable to take trading losses.Traders whose minds are distracted by prospect theory or mean reversiontendencies will likely lose over time. Whether due to a change in underlying fun-
30
PART 1 Structural Foundations for Improving Technical Trading
damentals or a shift in sentiment, market prices are moving for a good reason.Smart traders ignore the human bias of both prospect theory and mean reversionand establish positions in the direction of the breakout, while other traders withlosing positions hold on. The pain of these losing trades is eventually realized,and losses are very often closed near a market extreme. As we will see, usingquantitative trading strategies will mitigate these human tendencies and generatetrading strategies based on optimal historical performance—not psychologicaltendencies.The tendencies in human nature that result in prospect theory and meanreversion can generate great losses for pure discretionary traders. As research citedin later chapters will show, the preferred strategy in many markets is to sell newlows and buy new highs. Readers should keep in mind that this is merely only oneexample of utilizing systematic methods to take advantage of market inefficiencies. We will also explore methods to buy when everyone is selling, to trade offvery short-term strength and weakness, as well as trade the difference among similar or substitutable markets that may reach extremes.In each case, the very reasons that human nature influences our thinking mayallow quantitative trading systems to profit. After all, quantitative systems followmodels with specific rules based on historical performance and use the scientificprocess, instead of human intuition, to drive their strategies.In some ways, I find it ironic that trading can be so difficult and such a mental struggle. After all, this is the only profession where every decision is a binarychoice. There are only two actions a trader can make: buy or sell. But as can beseen by the above discussion on irrational buying and selling, there are obstaclesthat can make that binary choice difficult.
TECHNOLOGY AND INEFFICIENCIES IN FINANCIAL MARKETSInefficiencies do exist in financial markets, albeit not forever. Financial historytells wonderful stories about traders exploiting inefficiencies over the past 30years.Zero Coupon BondsIn the 1970s the U.S. Treasury first allowed its coupon debt to be stripped intozero coupon instruments. A 10-year bond that paid 20 coupons and a repaymentof principal could be stripped into 20 zero coupon bonds. These zero couponbonds, unlike a traditional bond that pays a coupon semiannually, are debt obligations that pay no coupons. Instead, zero coupon bonds trade at a discount toface value. Over time, the bonds accrete to par value, with investors receivingtheir principal (and effectively their interest payments) at maturity.