I was browsing my twitter feed this week and saw a couple old Quantifiable Edges posts (here and here) linked to by @PsychTrader. The two posts were written in mid-2009 and detail a simple weekly strategy that uses the relative performance of the S&P 500 and Nasdaq indexes to time the market. They showed how investing in the SP 500 or Nasdaq when Nasdaq has been outperforming (based on 10 week relative performance) has generally beat out buy and hold.
Since the posts were written a while ago, I took it on myself to test out the strat with recent data. I used SPY and QQQ weekly data from Yahoo Finance for my test. I compared price performance (adjusted for dividends) over 10 week periods. All performance calculations and trades take place at the end of the week. One tweak I made was to add a lagging week between a signal change and when a trade takes place. An example – if at the end of a week SPY goes from outperforming to underperforming over the past 10 weeks, I will not adjust holdings until the end of the following week. This seemed to enhance returns but results will be similar without it.
Below I will examine holding QQQ or cash depending on whether QQQ is outperforming or underperforming SPY. I’ll leave it to the reader to test holding SPY.
First let’s look at the period from 1999 (inception of QQQ) to the end of 2008. The strategy to invest in QQQ when it underperformed SPY got crushed during the bear markets and just treaded water during the bull market. The inverse strategy did much better and held its ground through bull and bear period alike.
What happened from 2009 forward? Take a look.
The strategy that sucked big time before has been steadily rocketing higher while the formerly better strategy has been treading water.
I guess this is just another example of strategies being turned on their head at the market’s whim. This is one I’ll be keeping tabs on going forward.
On a personal note, I’m proud to announce that my wife recently gave birth to our first child, a beautiful baby girl. We are greatly blessed if a bit sleep deprived. Still trying to keep up on markets but can be challenging while juggling my new dad responsibilities. :-)
I sometimes wonder if there’s anything useful in the volume data accompanying daily OHLC values from sites like Yahoo, et all. I haven’t had much success in the past. I’ve mostly ignored it.
Well, I got inspired to give it a go again and think there’s potential to use volume to enhance a trading system. Enough data mining can solve any problem, right?
I’ll describe a system I tested on various index ETFs and then compare the results with and without a volume filter. My goal isn’t to prove the system is great, just that using volume can potentially enhance a system’s profitability.
Ok, here are some rules for a base mean reversion system:
Buy at the close when 1) the close value is less than yesterday’s close AND 2) the close value is at least .5% below the 10 day SMA. Sell position 4 days later at the close.
Now we’ll add a volume filter:
In addition to the previous criteria, only buy at the close if current day’s volume is less than the volume of EITHER of the previous 2 days. (Note: we could use 1 day or 3 days, the farther out you go the less restrictive this filter becomes).
I think my initial thought was that buying on a bigger volume day would be better. Perhaps signaling capitulation. But no, a lower volume day is better in this case. And I guess that makes sense too as a type of negative divergence or perhaps exhaustion of sellers.
Here are some summary results for the system with and without the volume filter. Each ETF is tested from inception to July 9, 2013 using Yahoo Finance data.
The volume filter cut down significantly the number of trades. While total profits of the backtests were lower, the average trade profit and winning percentages were generally improved.
I’ve attached an excel book containing the backtest, summary stats, and profit curves for each ETF. Enjoy!
Excel Download – Trade System with Volume Filter
This morning I placed an interfund transfer request in my TSP account. This is a discretionary override of my systematic TSP strategy. I changed allocations to 25% C 75% G funds for my existing balance. I will keep a 40% C 60% G fund allocation for new biweekly contributions.
I’m getting more and more bearish for the rest of the year. What does this mean? Probably that the market is about to soar and you should load up on stocks. Well, maybe not…
We’re pretty far above the 200 day average and near all time highs and in a very mature bull market. I could be wrong but am playing it safe(r) here.
The allocation displayed in the top right of the site will continue to reflect the 40/60 allocation until an official strategy change occurs.
On a side note, XIV daily mean reversion (long only) has continued to crush daily follow through since my March post. I’ve been keeping an eye on it and playing it occasionally. I’m sure it will stop working eventually but am enjoying it (in small sizes) while it lasts.
On another side note, my life has been pretty hectic recently and I haven’t been able to do much of the market research I love. I’m hoping things will calm down by the summer.
Question: What’s one way you could have nearly doubled your money since last September with minimal drawdown?
Answer: XIV daily mean reversion! Well, a long only approach that is.
Daily mean reversion just means holding XIV if it declined in price the previous day. Daily follow through would be holding XIV if it increased in price the previous day.
Daily mean reversion was hardly a good strategy in recent years. In fact, since 2009 when VXX came into existence, this strategy performed relatively poorly while a daily follow through strategy did fantastic. That changed last September. I have no clue why.
Check out the chart below illustrating the recent performance of the two series.
One note, if one looks at simulated XIV before 2009 you can see this isn’t the only time mean reversion would have dominated. The same thing would have happened in 2007/2008. Is there anything to be read into that? Possibly not. Could just be random changes in the market.
There’s no telling how transitory this change will be. Just thought it was worth sharing.
Technical note: I just used inverse changes in VXX to create the series for the chart above. Good enough for illustrative purposes.
Every so often I come across a post or comment on some kind of XIV/VXX pair trade. I wrote one such post in 2011 toward the beginning of my volatility research. I thought I’d write another post now to shed more light on some of the ideas that get thrown around.
I’ll examine 3 types of trades here:
- Long XIV and long VXX
- Short XIV and short VXX
- Long XIV and short VXX
For each type of trade I’ll examine a 50/50 allocation (e.g. 50% short XIV/ 50% short VXX) and examine all the past outcomes of holding this trade 60, 90, and 120 days out. I’ll leave it to readers to try other combinations of weights, time lengths, and any fancy embelishments.
Note: Values before product inception are simulated based on the VIX futures .
Long XIV Long VXX
This pair goes long both products. The hope is that one of these breaks out and rises significantly from the purchase price. As an example, assume XIV rises around 100% over an extended period and VXX falls around 50% over that same period. In this case, the pair trade would be up 25%. If the returns are flipped around, the pair would still be up 25%.
This chart shows the return profile of purchasing the pair on the specified date and selling 60, 90, and 120 days later.
I was surprised by a couple findings while doing this analysis. I’m sure others have thought of them but they are new to me. These findings include:
- This pair only does well when a long XIV position outperforms a short VXX position over the specified period. In a sense, this pair is betting on that to happen.
- The returns of this pair are slightly negatively correlated to equities and nearly uncorrelated to government bonds. This presents promise as a portfolio diversifier.
Of the three pairs, I like this one best. Negative returns are subdued while positive returns can be quite high. It’s also the easiest trade to execute consistently as you don’t have to worry about finding shares to short.
Short XIV Short VXX
This pair is short both products. The trade is profitable when neither product rises that much from the purchase date. The return profile is inverse to the long/long pair. This pair only does well when a short VXX position outperforms a long XIV position over a specified period.
Below is a chart of returns for this pair. Because of the nature of short positions, it’s possible to lose more than 100% on a trade. Upside returns are also limited due to the decreasing leverage a short position provides as a shorted product declines in value.
I don’t like this pair very much. It can be profitable but really requires a lot more active management to avoid the issues of varying leverage shown in the chart.
Long XIV Short VXX
This pair is not neutral like the other two. You’re basically shorting volatility in two different ways. This means you better have a system for entering/exiting the trade. When the trade is working well it will outperform the other pairs given its directional bias.
Here is a chart showing past returns for the pair.
The short part of the trade presents the same leverage issues as the short/short pair shown previously. I personally prefer using a simple long XIV position for shorting volatility.
Pair returns compared to equities and bonds
I mentioned earlier that the long/long pair had slightly negative correlation to equities and near zero correlation to bonds. Here I’ve posted a chart comparing the long/long pair to returns of SPY and IEF over 120 day holding periods. There appears to be some nice diversification going on.
I’ve charted below differences in open, high, low, and close values between Yahoo Finance and PI Trading for the SPY ETF between 12/30/02 and 11/9/12 (last date in my PI dataset).
I haven’t seen this kind of comparison done elsewhere (let me know if you have). I’ve done this to illustrate just how different various data sources can be. Enjoy!
(Note: Reader James reminded me of a similar comparison made here – http://www.quantifiedstrategies.com/the-importance-of-good-data-sets/ that compared Yahoo finance to IB. Check it out as well.)
I was surprised how close the opening quotes tended to be between the two datasets. There are a handful of big divergences. There seems to be an even spread between higher and lower values.
When the two data sets diverged here, Yahoo finance almost always had higher highs. I think this is a result of bogus, non-tradeable quotes being recorded by Yahoo.
When the two datasets diverged here, Yahoo Finance almost always had lower lows. Again, I think this a result of bogus quotes recorded by Yahoo.
The close quotes differed more than I was expecting. The differences have been smaller though since 2009ish. As with the open comparison, the distribution of values above/below 0 seems random.
I don’t know whether the PI Trading dataset is superior to other sources for testing. It seems reasonable to me that it is more accurate at least than Yahoo Finance, especially for high and low values.
The daily OHLC data from PI was constructed from minute level data. The dataset is missing a day for 1/30/07. Part of the morning of 1/31/07 is also missing.
When comparing the close, I excluded days where the markets closed early.
The more I trade my Alpha 2 system the more data issues I become aware of. The system uses OHLC data in its inputs which can be trouble. Different sources have significantly different quotes for some days.
I’m taking a short break from trading this system. I’ll begin posting trades again when I’m more confident in the data being used for testing and live trading.
Any suggestions for sources of clean OHLC stock data are appreciated. So far I’ve compared data from PI Trading (constructed from 1-minute), Bloomberg, and Yahoo finance.
The Alpha 2 strategy went back to cash at today’s close.
I sold half of my position early (discretionary override) on Feb 5th for $21.75 (+3.6%) and the other half today for $22.50 (+7.1%). My average gain was about 5.4%. I sold half early because I did not like the expanding volatility in the market and thought I could outsmart my system by rebuying some shares lower.
**Note: made correction to Feb 5th sale price. Sale was at 21.75 not 20.75 as first reported above**
The volatility strategy went long XIV at today’s close. I got in at $21.00.
Here’s a potentially useful indicator for timing the S&P 500 on a weekly basis. Consider the following two strategies:
1. Hold SPX when VXO rose the previous week, else hold cash.
2. Hold SPX when VXO declined the previous week, else hold cash.
Here’s a chart comparing the two strategies since 1986 (not adjusted for dividends).
Not bad. Risk/reward has historically been better when VXO rose the previous week. I guess this makes sense from a mean reversion standpoint. It seems to me this indicator works best when market volatility is high (e.g. late 90′s/early 00′s and financial crisis-present). The indicator wasn’t as valuable during the early 90′s and 04-07 period.
The strategy experienced a number of big losses in this backtest. This happened when SPX fell sharply several weeks in a row while VXO continued to break out to new highs. A filter could be added to the above strategy to filter out some of the potentially big declines. One effective filter would be to avoid holding SPX when VXO closes the previous week more than 20% above its 5 week moving average. The parameters for the filter seem fairly robust. Setting the % too low will weed out a lot of profitable weeks while setting it too high will fail to avoid many of the worst losses.
The chart below compares two strategies:
1. Hold SPX when VXO rose during the previous week AND VXO closed the previous week less than 20% above its 5 week average, else hold cash.
2. Hold SPX when strategy #1 is not in play, else hold cash.
A number of large losses are filtered out without sacrificing too much performance in other time periods.
Here are some stats for the whole period and for 2009 to present.
All data is from Yahoo Finance. Using VIX would have generated similar, though not quite as good results. You can download an Excel copy of this backtest here: VXO SP500 Weekly Strategy