Part 2 (2/2)

FIGURE 3.3 Daily percentage difference in American Airlines (AMR) and Continental (CAL).

We can see from this chart that the volatility of the AMR-CAL differences changes drastically over the four years. First, from the beginning in September 2005 until September 2006 volatility was uniform, with daily percentage differences ranging from about +5% to 5%, with a maximum of about 8%. For the next 9 months, volatility dropped. Had we been trading before July 2007, we might have created the following trading rules: Sell short AMR and buy CAL on the close when the daily change in AMR exceeds the change in CAL by 2.5%.

Sell short CAL and buy AMR on the close when the daily change in CAL exceeds the change in AMR by 2.0%.

Selling AMR with a 2.5% threshold and selling CAL with a 2.0% threshold accounts for the upward bias we can see on the chart, where the maximum was 8% and the minimum about 5%.

After May 2007, volatility begins to increase until by mid-2008 when the maximum difference has become 17.5%, far greater than the previous 8%. Had we sold AMR at a 2.5% difference over CAL using our previous rules we would have, theoretically, been holding the same trade when the difference reached 15%. But that would never have happened. When the trade reached 10%, we would have all rushed for the exit, forgetting the opportunities. Without going through the tedious exercise of figuring out all the trades, we can see that the basic method has too much risk and too much variability. This method may have worked during the 1960s, but it is not the one we want now.

It is also good to see that we used the chart to decide buy and sell levels that were not symmetric. These levels, 2.5% and 2.0%, clearly fit the pattern but are not a good way to find a solution. Generally, we see this skew in the prices because the stocks have been moving in one direction, in this case up, or the volatility of one stock is greater than the other. When prices change direction so does the skew. A solution that is going to last will need to be more robust, and the safest approach will always be a symmetric solution.

Changing volatility is also a good lesson in why using more data is better than fewer data for testing. If you were to choose only the last year of data, then you get a narrow, unrealistic idea of market patterns. Whatever program you develop will have a short life span. When you see a structural change in the volatility, you need to consider a more dynamic way to adjust to the market. In Figure 3.3, there are three distinct volatility regimes: moderate, low, and high. By finding one method that adjusts to these situations, you can create a more robust approach.

What is needed is a way to adapt the entry levels to changes in market volatility. We not only are concerned with increased volatility and the a.s.sociated increased risk but also realize that if volatility falls, as it did in 2006, and we're waiting for a 2.5% difference for an entry trigger, then we could wait months before seeing a new trade. The problem needs to be solved for both increasing and decreasing volatility.

Relative Differences.

The solution to adapting to changing volatility is to recognize relative differences. One method of showing relative differences is to use a momentum indicator, such as relative strength (RSI), stochastic, or moving average convergence-divergence (MACD). They all accomplish the same thing in slightly different ways. In our examples, we'll use the stochastic indicator because it is easier to calculate and, interpreted correctly, will give you the same results. In addition, it has less lag than the other indicators. The basic calculation for the stochastic is where Ct is today's close, min(Ln days) is the minimum price (the lows of the day) over the past n days, and max(Hn days) is the maximum price (the highs of the day) over the past n days. The denominator is then the maximum to minimum price range of the past n days. The stochastic indicator actually shows the positioning of today's close within that range, essentially expressed as a percent measured from the low of the n-day range to the high of that range.

The value of the stochastic can vary from 0 to 100. If the past range for AMR was from $22.00 to $18.00 and the close is now at $19.00, then the stochastic will be 25. If today's close was a new high, the stochastic would be 100.

For those familiar with this momentum indicator, our definition is for the raw stochastic. Most trading software show a much slower version, created by taking the 3-day average of the raw stochastic, then again taking the 3-day average of that result, giving essentially a 4.5-day lag (half of 9 days). For our purposes, that creates an indicator that is too slow.

Table 3.2 gives an example of the raw stochastic calculation from the beginning of the data. The calculation period is 10 days; therefore, the first 9 data rows are blank. Beginning in row 11 on February 3, 2000 (row 1 has the headings), column H shows the high of the past 10 days = max(B2:B11) and column I shows the 10-day low = min(C2:C11). Using the highs and lows of the past 10 days, we can calculate the AMR stochastic in column J as = (D11-I11)/(H11-I11). Once both AMR and CAL stochastics are calculated in columns J and M, the differences = J11-M11 are entered into column N.

TABLE 3.2 Stochastic indicators created from AMR and CAL daily prices.

If we calculate the traditional 14-day stochastic (usually the nominal calculation period found on charting services) for AMR and CAL during the second half of 2007, we get the picture shown in Figure 3.4. Both markets move in a similar way between 0 and 100; however, they do not reach highs at the same time, and some of the lows are also out of phase. Without those differences, there would be no opportunity. Based on this view of the divergence in the two stocks, we can devise trading rules that profit from it. Although we think that we can see where the momentum values are farthest apart, the first step is to show those differences more clearly. That can easily be done by plotting the differences between the AMR and CAL stochastics, as shown in Figure 3.5. We'll refer to that as the stochastic difference (SD), in column N on the spreadsheet.

Stochastic Difference.

Figure 3.5 shows both the annualized volatility and the stochastic differences for AMR and CAL. The second half of 2008 was chosen because of its historically high volatility, when everyone thought that the end of the world was coming. It is interesting to see that the stochastic difference did not peak at the same place as the volatility spike. Instead, the bottom line in Figure 3.5, M1-M2, shows that the stochastic differences peaked in May 2008 at a value of about 50 and had numerous lows of about 50 throughout the year. The low levels are more consistent than the peaks, but this is only six months, or 5% of the test period.

Experience teaches us that we should not attempt to fine-tune these levels or bias our trading to expect the extension on the upside to be smaller than the downside. At some point, whatever causes these charts to be asymmetrical will change. Those readers familiar with trend-following systems may have noticed that during the 1990s, when there was a clear bull market in stocks, long positions would have been held longer and shown larger profits than short sales, making the performance noticeably asymmetrical. If we had decided to optimize only the long positions or bias our trading to the long side, the result would have been to hold the longs even longer and possibly not trade any shorts. That would have been a financial disaster after 2000, when prices headed down for more than three years. If we don't know when the next major economic cycle will start, using symmetrical trading rules is the safest approach.

FIGURE 3.4 14-day stochastic momentum of AMR and CAL, second half of 2007.

FIGURE 3.5 The stochastic difference (SD) of the AMR stochastic minus the CAL stochastic, shown with the AMR and CAL prices during the second half of 2008.

Exits.

When planning a trading strategy around these numbers, our nominal exit should always be at a stochastic difference of zero, indicating that the relations.h.i.+p between the two stocks has gone back to equilibrium. For some traders, that might be unnecessarily strict. We should also consider exiting shorts above zero and exiting longs below zero. This would cut profits short but a.s.sure us that we would safely exit more often.

There is always a temptation to hold a short position until the stochastic difference moves from the high entry to the low point, where we would reverse and enter a long position, for example, from a stochastic value of 80 down to 20. Profits would be much bigger and transaction costs less important. But that's not the way the market works. A relative distortion, as we recognize with the momentum indicator, is likely to return to near normal but has no reason to reverse. In our 6-month example, CAL tends to lead AMR, then fall back to normal, and then lead again. We would be exposing ourselves to very high risk unnecessarily if we waited for AMR to lead CAL in order to exit a long position.

Implicit Bias.

As we look at Figure 3.5 and consider the rules, we see that if we sell above 45 and buy below 45, there is only one short trade and four longs. If we choose 25, there would be a lot more trades on both sides, but that would force us to hold those trades with larger unrealized losses. Those are cla.s.sic trade-offs that we will consider later in the development process.

None of the strategy rules will consider asymmetrical parameters. There has always been a bias in the stock market because history has shown a steady increase in the average price of a stock or an index. One example of this bias is the traditional definition of a bull and bear market. A bear market begins when the DJIA turns down by 20%, and a bull market begins after the DJIA turns up by 20%. However, after a decline of 50%, a rally of 20% is actually a recovery of only 10% of the value lost in the downturn. Then the threshold can be twice as large to enter a bear market as a bull market, a definite bias toward the upside.

The 20082009 stock market decline of 50% points out that those upward biases may have provided small improvements during good times and large losses when they go wrong.

The rules in this strategy, and others given later in this book, will all use symmetrical thresholds. A short sale signal will occur when the stochastic difference moves above 40, and a buy on the first day that the stochastic falls below 40. Exits will initially be at retracements to zero.

TABLE 3.3 AMR-CAL trades based on the difference in stochastics, 2008.

Results for Stochastic Difference.

In tracking the performance, there are five trades during this period with a total return of $350.39, or $0.468 per share (as shown in Table 3.3). At that level of return, the method would still be very profitable after costs and slippage. However, this is a single example and not typical of a wide range of performance.

The list of trades also confirms the rules. In the first trade, on January 14, 2008, the stochastic values were both very positive, but CAL was much stronger than AMR, 82.2 compared with 41.8. The difference, AMR CAL, was 40.5, below the 40 threshold to trigger a buy of AMR and short sale of CAL. On February 4, 2008, the stochastic difference moved above zero, and the trade was exited for a loss. Four of the five trades during 2008 were triggered on CAL being stronger than AMR.

It shouldn't be surprising that there are profits because we picked our buy and sell thresholds off the charts and then just verified that those values generated profits. The advantage of this method is that the stochastic should adapt to many different price patterns, including changes in volatility. Remember that the intention is to find a method that would adapt to the more volatile period beginning June 2007. In this first test, the threshold values of 40 generated only five trades in a year. We would prefer to trade more often.

Different Position Sizes.

Notice that the sizes of the CAL positions are different from the nominal AMR position of 100 shares. That is because a volatility adjustment was used. As we go through this process, the size of the two positions will be an important way to control the risk and improve the chance for a profit. In this case, a rolling volatility measurement was used.

To find the volatility-adjusted position size, we begin by a.s.signing a fixed size to one leg. In the previous example, AMR always traded 100 shares. Next, we calculate the average true range (ATR) of each leg, measured over the same n days. For any day, the true range, TR, is the largest of the high minus the low, the high minus the previous low, and the previous close minus the low: The ATR is the average of the past n values of TR. Then, if the ATR of AMR was $0.50 and over the same period the ATR of CAL was $1.00, we would trade twice as many shares of AMR as we would CAL. It is important to remember that this is a critical step in trading two markets simultaneously. They must each have the same risk exposure. If you miss this step, there is no way to correct for it later. This will be discussed in more detail in the section ”Alternative Methods for Measuring Volatility,” later in this chapter.

Had we not adjusted the position size of each leg, the only alternative would have been to trade 100 shares each, with the results shown in Table 3.4. This method returns a total profit of $178.00 with $0.18 per share compared with the volatility-adjustment method of $350.89 and $0.47 per share. Of course, this is a very small test period, and the results could have greatly favored taking equal positions, especially if it was the CAL leg that was most often profitable. But the performance would have depended on the chance that the leg with higher volatility was the one generating profits, which is not good risk management. There is no subst.i.tute for volatility-adjusting each leg of the trade.

TABLE 3.4 AMR and CAL with equal position size.

Alternate Approach to Position Size.

The idea behind volatility-adjusted position sizes is that every trade should have an equal risk. That way you maximize diversification and are not making the unconscious decision that one trade is better than another.

In the previous process, we started by fixing the position size of one leg at 100 shares and then finding the number of shares in the other leg that caused risk to be equal. An alternative approach is to a.s.sign some arbitrary investment size to each stock, say, $10,000, and then: Calculate the average true range of the stock price over the past 20 days.

Divide the nominal investment size by the average true range.

The result is the number of shares needed to equalize the risk of the two stocks. These can be done for any number of stocks, and all will have been adjusted to the same risk. When you're done testing using these position sizes, the results can be scaled up or down by multiplying all stock positions by the same factor to reach a target volatility or an investment amount.

<script>