From the September 01, 2011 issue of Futures Magazine • Subscribe!

Mining for profits in modern markets

The approach to most market timing in the early 1980s went something like this: Calculate a particular indicator over N days, buy the market when the indicator went to X and sell when it got to Y and, possibly, sell and go short when it got to Z. There usually would be a chart associated to demonstrate the virtues of the strategy based on the last half a dozen or so signals. This was around the same time when desktop computers were becoming common, if not at home, at least on the majority of traders' office desks.

With a background in probability and statistics, it was a simple leap to consider taking any simple indicator, such as a 10-day put/call ratio on an index of interest, have the computer calculate the measure for you and go back through history and quantify how the corresponding market had behaved in the past based on similar observations. Then, going forward, you would have not only a buy/sell signal, but a confidence of probability associated with each day. Somewhat basic at the time, the ease of obtaining and testing data in this way has come a long way in 25 years.

For traders, it seems turnkey. If the indicator is at, say, 1.20 (with 1.0 being the mean), go find all the 1.19-1.21s and see how much damage was done in this spot in the past. Trade accordingly going forward. Get rich. Retire.

Room for improvement

Most analysts hit on nuances of this approach almost instantly. For example, a 1.2 coming from a 1.3 is probably a different animal than a 1.2 that is coming from a 1.1. Certainly, there are profits to be had by making this distinction.

So, rather than searching for a simple 10-day moving average, let's add a second level of detail and calculate both a 10-day and a 20-day moving average and search on both. That way, we would know whether the 10-day moving average is coming from a higher or lower level depending on the measurement taken on the longer 20-day moving average.

It's also not much of a stretch to consider whether, say, high put/call ratings (around 1.20) could possibly mean one thing when the market itself is in an uptrend and something different when the market is in a downtrend. So, similarly, you can search for two additional variables based on the trailing price trend.

The next logical round of analysis is teaching the computer how to simulate the trading of the strategy and then mixing the indicator with a series of other relevant indicators for a slightly more complex multi-indicator model. Once you do this, you can experiment with different variations of the time intervals (10 and 20) and choose those that fit the indicator more precisely. With a little work, you can set the computer up to study millions of combinations of all the variables and optimize to get the best performance over history.

Too good to be true?

Many traditional technicians cringe when they hear of such multi-indicator, optimized approaches. Curve-fitting concerns instantly develop. Admittedly, a major drawback to this approach is that each time you add an additional variable, you need more data to find good fits. Anyone who is a student of statistical theory is aware that you lose a degree of freedom with each additional variable added.

This brings into question the level of confidence you have in the results. If you are modeling a time period that has five different market cycles, there exists somewhere a set of five different variables that can be modeled that result in perfect performance. This is the basis for the KISS (Keep It Simple, Stupid) approach to modeling. In theory, you would much rather have a one-variable model with an average 10% annual return than a five-variable model with a 12% return. The odds of the former behaving in the future like it did in the past are much higher than that of the latter.

One of the ways to deal with the curve-fitting concerns is to test the system on an out-of-sample data set. That is, optimize the indicator on one set of data, say 1970-2000, and then test it on another set of data, say 2000-2010. Even this can be inherently faulty, as the market averaged 9% a year over the 1970-2000 period and was flat during the first decade of the 21st Century, giving bear market signals a better opportunity for success over the out-of-sample period.

At minimum, even without out-of-sample studies, the system should be tested over several different market cycles. Use common sense in your modeling. For example, several systems were readjusted after the 1987 crash to ensure the trading thresholds were 0.001 above or below where they needed to be on the right side of a one-day 22% move. This is one reason you should focus on median results rather than average, so that a single crash data point doesn't drive the system.

Diving into the data

You can continue to add additional layers of complexity until you simply turn the computer loose on data. This is referred to by many as data mining, or looking at all combinations of variables in the system. Opponents of this approach associate it with curve-fitting, and argue that if you measure enough noise, you are likely to find some aberrant behavior. There is some validity to this argument, and a reason you should look for confirmation from two or more indicators.

I refer to my data mining model as PTA8. Each day, the model looks at seven different tape measures over 21 different time frames and quantifies the market's performance in similar past instances. It looks for days where you get extremely rare performance over 30 similar data observations. Three-standard deviation results are rare, but consider the data from May 18 (see "Breadth analysis," below).

Click on chart to enlarge.

ADTn is the percent of advance in n days. Looking at the first row, the ADT1 is equal to 84.27 and the 100-day exponential moving average is 1.16. XMA100 is a 100-day exponentially smoothed price trend indicator normalized to -3 to +3 standard deviations. The value for the XMA100 indicates it is at +1.16 standard deviations. The model looks for ADT1s between 82.57 and 86.39 with an XMA100 between 0.75 and 1.56. The average three-, six- and 12-month forward performance follows and is normal. The same approach is taken for two to 21 days in the subsequent rows.

One strong signal occurred on May 10, when there were 444 advances and 52 declines, yielding an ADT1 of 89.52 on a day when XMA100 was +1.42. "Rare air" (below) shows the 30 best matches for those type of occurrences, listed in order of closest match.

The effort to model the market accurately is never-ending. The best results are obtained from developing indicators derived from all possible angles. This provides a feel for an indicator's nuances, offering insight to bring the indicator back to as simplistic form as possible. It is one thing to create an incredible backtested system and yet another to develop one that will achieve those same results into the future.

The 52-week high

he nice thing about data mining is that relationships are everywhere. Consider the 52-week high. Over the two trading sessions July 10-13, only one issue on the S&P 500 index made a new 52-week high (NHPCT2 = 0.20), yet the XMA100 finished positive (+0.22) on June 13. This is unusual and historically has been bullish on an intermediate time frame.

The accompanying table shows the 30 occasions since 1970 when the NHPCT2 was between 0.10 and 0.30 and the XMA100 was between 0.02 and 0.37%. The forward S&P performance was encouraging for all four forward time frames identified. If listed these in order of best matches, the top 10 were all positive one and three months later.

Whether these data will tell a tale that stands the test of time is debatable. However, they show that unique situations persist. The key is having a diverse enough database to uncover profitable relationships.

Wayne Whaley holds a Master's degree in systems engineering from Georgia Tech, is co-owner of Witter & Lester (CTA), the 2010 MTA Charles Dow Award winner and publishes daily commentary on his market signals. Contact him at wayne@witterlester.com.

Page 2 of 5