Premium Market Analysis, Trader Education, Software, and Trading Strategies. Thirty Years Of Skin In The Game

Quantitative trading

Fooled by Structural Upward Bias

Some quants are fooled by the longer-term upward bias in equity indexes such as the S&P 500 when backtesting trading rules. This structural  bias makes it hard to distinguish between profitable algos and spurious correlations unless the quant is willing to do some extra smart work.

The structural upward bias in indexes such as the S&P 500 is the effect of continuous rebalancing. In turn, the rebalancing is made possible due to economic activity and wealth creation leading to new IPOs of private companies. In effect, the S&P 500 is a trading algo. I have talked about this in a previous post. It is the trading algo whose performance other derivative trading algos try to match or even exceed, in many cases without much luck.

SPX_ALL

Take any simple random pattern and backtest it in S&P 500 data from 1950. For this example I chose the following:

If  close of today < close of 14 days ago
then buy at the next open

Below are the results of a backtest for 7% profit target and stop-loss:

SPX_20150423_BT_Random_7

The backtest results show a Compound Annual Return (CAR) of 5.57% on a sample of 279 trades with 60.93% win rate. Buy and hold (without dividends) is 7.69%. Do we have something here?

We (or some of us) have been fooled by structural upward bias. This random pattern has no predictive capacity. If it had any predictive capacity, it should also work well for a profit target and stop-loss of 2%, with the results shown below:

SPX_20150423_BT_Random_2

CAR is now negative and win rate is barely above 50%. What is happening here is that this pattern is indeed random but for larger profit target and stop-loss it shows good performance because the structural bias has time to kick in. With 2% profit target and stop-loss we are only testing its market timing ability. This random pattern has no such ability.

The funny thing is that genetic engines will apply a trailing stop to similar random patterns and fool unsuspected users of such programs into believing that they have something when in fact they have nothing and the algo is a bad imitator of buy and hold investing.

Some other quants, or genetic engines, use time stops instead of percent targets. Same story is true here. These are the results for 30-bar exit:

SPX_20150423_BT_Random_30Bars

CAR is 6.05% for a little pattern such as this one. Win rate is nearly 62%. This is what happens when the entry signals are exited after two bars:

SPX_20150423_BT_Random_2Bars

CAR is only 0.33%, win rate is a little above 50%: random pattern with no predictive ability. The only reason that performance is high for an exit of 30 bars is because there is enough time for the structural upward bias to kick in. The pattern has nothing to do with that.  The algo is a bad imitator of buy and hold but in hindsight only.

If backtesting results are affected by the structural bias, then they are useless and only reflect the longer-term tendency of some markets to go up or down. The bulk of the analysis in the blogosphere is useless because of that. Only rarely one sees test that account for any bias in the price series.

The question is then: should price series be detrended. I have no easy answer for that but it may be the subject of a future blog. Do not let anyone fool you that there is an easy answer to this question as it mainly depends on what you are trying to accomplish.

You can subscribe here to notifications of new posts by email.

Charting and backtesting program: Amibroker
Disclaimer

© 2015 Michael Harris. All Rights Reserved. We grant a revocable permission to create a hyperlink to this blog subject to certain terms and conditions. Any unauthorized copy, reproduction, distribution, publication, display, modification, or transmission of any part of this blog is strictly prohibited without prior written permission.