Wednesday, December 9, 2009

Developing A Trading Strategy (Part 2)

In part 1 of this series, we looked at some tools that I use to evaluate the appropriateness of a trading strategy. In this article, we will explore the use of a filter to improve not only the reward to risk profile of the strategy but also the feasibility of implementing and trading that strategy.

Our initial strategy was based upon weekly S&P500 data going back to 1984, and our signal to go long the S&P500 was when price was greater than or equal to its simple 40 week moving average; positions were exited and you went to cash when prices closed below the simple 40 week moving average. Simple enough.

Since 1984 such a strategy generated 843 S&P500 points, and in the same time period, buy and hold yielded 929 S&P500 points. For our efforts to time the market with this strategy, you would think that maybe draw down (or loss of capital) would be improved. But it wasn't and in fact, such a strategy produced a draw down equivalent to buy and hold. So what is the point of trading this strategy? Neither reward or risk are improved.

Furthermore, I would find this strategy hard to trade because it goes through a period where it produces a lot of whipsaws - a lot of trades that were little losers. Aside from the poor reward to risk profile, this strategy produced 10 consecutive losing trades, and I would personally find this hard to execute.

The concept of trading a simple moving average system seems appealing. We are either in or out and for the most part, we just go with the big picture trend. But as you see, it isn't that simple. So how can we improve our strategy?

By adding a filter to weed out a lot of those little losings trades (or buying at the top of bull market) and at the same time, the filter will not keep us out of the market when a blockbuster trade is underway.

So what filter will I introduce? In this instance, I am going to use the composite indicator constructed from the trends in gold, crude oil, and 10 year Treasury yields. Why this indicator? Over the years like any good market analyst, I have looked at various intermarket relationships. I knew higher Treasury yields were never good for stocks, and equity markets seem to top with spikes in crude oil. Furthermore, gold was a safe haven in times of market turbulence. If these markets were trending higher, it seemed to me that stocks should be headed lower. As it turns out, this is pretty much the case, but the question for me was as always how to quantify such observations and could I use them in my trading.

I quantify the strength of the trend of each asset, and equally weight each within the composite indicator, which is shown in the lower panel of figure 1, a weekly chart of the S&P500. But how correct is my notion that equities under perform when the trends in these assets are strong? Or to put it another way, how do equities perform when the trends in these assets are weak?

Figure 1. S&P500/ weekly

So let's apply buy and sell signals to the filter alone. In strategy #1, we will go long the S&P500 anytime the indicator in figure 1 is below the extreme zone, and we will sell the S&P500 when the indicator is equal to or greater than the extreme zone line. The simple 40 week moving average has nothing to do with this strategy, and because in this example the composite trend of our filter is weak, we should expect equities to outperform.

This turns out to be the case.

Since 1984, this strategy generated 1531 S&P500 points; buy and hold did 935 S&P500 points. There were 57 trades of which 72% were profitable. The maximum number of consecutive losing trades was 3. The maximum draw down to one's equity curve comes in at 46%. This is too high for my liking but it is less than buy and hold. Your market exposure is cut to 57%, and there was one outlier trade accounting for about 25% of the profits.

In sum, I like these results. It pays to be in the market during those times when the trends in gold, crude oil and yields on the 10 year Treasury are weak. In essence, you make 1.64 times a buy and hold return with 43% less market exposure; in addition, draw down is reduced by 40%.

The equity curve for this strategy is shown in figure 2. It has a nice 45 degree slope to it.

Figure 2. Strategy #1/ equity curve

The maximum adverse excursion (MAE) graph for strategy #1 is shown in figure 3. There are too many trades (actually 8 trades) with draw downs of over 10%. This is high when talking about the S&P500. Maybe we can improve this when we add this filter to our 40 week simple moving average system. It should be noted that the 4 worst trades occurred in the last 2 bear markets (2000 - 2002 and 2007 to present), so if we can just eliminate those, I think we might have something.

Figure 3. Strategy #1/ MAE

Now let's run strategy #1 in reverse. In this instance, we are only long the S&P500 when the indicator in figure 1 is equal to or above the extreme line. In other words, we are only long when the trends in gold, crude oil, and yields on the 10 year Treasury are strong. We will call this strategy #2.

Since 1984, this strategy yielded a negative 585 S&P500 points. Only 43% of the 56 trades were profitable, and the amount of time spent in the market was less than 8%. These are incredible results considering that over two thirds of the time was spent in the best bull market of the century. These results tell me that equity risks are rising when the trends in gold, crude oil, and yields on the 10 year Treasury are strong.

Figure 4. is the equity curve for strategy #2; I want to avoid this.

Figure 4. Strategy #2/ equity curve

The MAE graph is shown in figure 5.

Figure 5. Strategy #2/ MAE graph

So let's summarize. While far from perfect, our filter appears to have the potential to improve our simple moving average system. Furthermore, a moving average, being price sensitive, will always keep us on the right side of the trend. Therefore, this will likely improve the function of the filter and help us avoid the bear markets. In part 3 of this series, it is my expectation that synergies of the moving average system and filter will be realized when combined together.

1 comment:

Aboot-Bull said...

Hi,

How do you measure the trend in each of the three assets in order to constract the new indicator ?

Thanks
D.W