Friday, February 11, 2011

Thinking about Market Timing Strategies

In my 4th year undergrad I tried to create a crash predicting model based off of asset correlations. The idea was that as markets crash, unrelated securities correlate. The model failed for two reasons, by the time correlations really got underway the market had lost a lot, and markets correlate on the way up too.

But now that it's mid term week, I have a lot of "free time" on my hands and the bug bit again. This time I was going to make a much simpler model, based off of only variance. If I wasn't in the market I would be investing at the risk free rate, but as soon as I hit my buy signal I would plow everything I had in marketable securities into the market and keep it there. When my buy signal was tripped off I wouldn't sell any securities, but any new cash would be invested at the risk free rate until I hit a buy signal again.

Thesis
I predict that I can accurately enter market bottoms, by buying only on occasions where volatility is at its highest. I predict that these timed buys will yield profits that outweigh the opportunity cost of not investing in the market at all times.

Methodology
I have two time periods, from 1955 to present, and from 2000 to present. I have monthly S&P 500 and risk free rate data. I assume no transaction costs (or that I have a lot of capital). For presentation purposes I assume I have $1 of capital to invest each month, it can either be invested at the risk free rate, or buy a $1 stake of the S&P 500.

Variance has been calculated at the 6 month average Z score (average S&P value over last 6 months / standard deviation of S&P over last 6 months). The Z score is needed to standardize the non-randomly dispersed sample data (the index increases over the time period).

The buy signal is the manipulated variable, and is compared against the ratio (current 6 month Z score / average 6 month Z score for entire period). For instance if [buy signal] < Zcurrent/Z_ave then buy the market. Note that when markets are volatile the ratio is small, and when calm the ratio is large, bounded at 0. Also note that because we use the average 6 month Z from the whole period this is an ex post study, although it wouldn't be hard to estimate ex ante.

As stated above, if we don't have a buy signal we put $1 in a risk free investment. This $1 will be compounded monthly and receive additional $1 investments each month until a buy signal is reached. When a buy signal is reached the entire money market balance is invested in the S&P never to be sold. If the following month is also a buy signal, $1 is invested in the index at that months value, never to be sold. The first period that there is no buy signal, we invest $1 into a now empty money market account and the process starts again.

Results

1955 to Present
Before we get to the model results it is useful to look at the comparative returns between the S&P and the risk free rate.
This graph shows what dollar return you would get if you invested in either the S&P or the risk free rate some time in history. For instance in 1965 you would actually make more money on a dollar invested at the risk free, than you would in the S&P if you held them both to today. Thus although it is clear equity returns trump risk free return, there are exceptions, and abstaining from the market may provide good returns if timed correctly.

So let's put the strategy to work.
It sucked. The red line shows the number of trades, the blue line shows the return minus what you would make if you bought and held from 1955 ($6645 when investing a dollar a month). This is what a lot of the literature says, you can't beat the market, you need to be in it all the time. The horizontal access shows the buy signal value; because we only buy when the market is risky, the far left returns are when we hardly buy at all, and the far right returns are when we are almost always in the market (buy signal almost always on).

Just for fun I flipped the buy signal methodology. Now I want to buy when the market is at it's stablest, and invest in the risk free rate when it's at it's riskiest. Theoretically this doesn't make sense, risk should bring reward; but sometimes investments is about being contrarian so let's see what happens.
Would you look at that. It works! This graph works backwards to the one above, results on the left are when we are in the market the most, and the results on the right are when we are in the market the least. It looks like somewhere on the right hand side we hold off till an optimal moment, and then invest making an extra $3351 over the market return of $6645. I dug into it and below we see where that transaction actually takes place.
It just so happened that the last 6 months of 1983 were incredibly stable, Z/Z_ave peaked at 131, and we hit a buy signal in January of 1984 after investing only in risk free securities for 29 years. We dumped $1208 of compounded assets into the S&P, invested a further $1 in the S&P the next month, and then stuck to the money markets for the next 27 years to get a total return of $9995. This looks great but it is a data mining result in my opinion. If we drop our buy signal for 3.6 to 3.0 we make a $10 loss as shown below. It's to jumpy to be predictable.
We see here that buying earlier, in 1974, and later in 1993, although visually benign, totally wreaks the return profile with a slightly negative abnormal return.

2000 to 2011
So if it doesn't work in the last 55 years, how about the last 11?
Expected results this time, the low volatility strategy that worked above never significantly outperforms and the high volatility strategy that didn't work above, does create major positive returns with buy signal thresholds between 0.1 and 0.5. On the graph this looks like a very narrow window of opportunity, but we must remind ourselves that ratios compress outcomes between 1 and 0 and so there is a fair bit of room to work with.(As the numerator shrinks the marginal change in the ratio is less per unit change in the numerator.)

So what does the buy timing look like.
Graph error here and below. It should be "less than" and it's not 3.5% is 3.3%
We see in this strategy we abstained from the market up until volatility reached it's peak in the crash of 2009. The 6 month window worked in our favor here, if we were using a shorter window we would have likely bought in higher. This resulted in a $53 dollar over performance against the buy and hold which yielded $146 after 11 years of $1 monthly investments. This works out to a cumulative annual return of ~3% over the benchmark, not bad at all. However again this is a pretty optimal data set. It is surprising how much return we have to give up in order to grab 2002 as well.
We lose more than 1% in annual return, by grabbing both dips (which is what we want in an ex ante mindset). This loss is of course the direct result of the 2009 crash, even the best market timer was behind in 09; risk free would have been better.

Takeaways
It's not time to set up a hedge fund, the results are mined and ex post. It is however an interesting result that we can think about in the future. When the 6 month Z score is 3 times smaller than the historical Z score (30.74) we have a historical suggestion that we have reached a bottom.

Timing strategies - when they work - are chunky, you fall from a winning position to a losing position with small deviations of your buy signal. Considering this buy signal will need to be derived from ex ante data, the margin for estimation error is very slim. 

Contrarian strategies may work. Surprisingly a 1955 investor who waited for extremely stable markets to invest, and avoided rocky markets, could have done extremely well if their buy signals were just right.

No comments:

Post a Comment