Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
S&P Sector Arbitrage

I put this strategy together a couple weeks ago while the market was going haywire. The increase in volatility caused the spreads between SPY and some of the sector ETFs to deviate from their normal range, so I went looking for trades.

XLE is is by far the most out of whack, this is a shot of the 100 day spread, it's still close to an all time high.
100 day SPY/XLE spread

I tossed together this algo to backtest this sort of trade. It buys/sells the spreads between SPY and sector ETFs when the z-score of their spreads deviates outside the +-2 range. This test used a 100 day regression without a constant term to keep the algo close to market neutral. It looks like these trades have been arbitraged away in recent years, but maybe with some modifications and some tlc you can get it working.

A drawback of this is long periods of inactivity, maybe replacing the assets with ETF/component stocks would increase the trading activity. Then again, with Quantopian there's no need to maintain a tech infrastructure, so infrequent/long horizon strategies can essentially be left running indefinitely.

2 responses

Hi David,

Here's a hunch...

I figure that SPY could be thought of as basically a linear combination of the sector ETFs, right? The problem is that if the weights change, then you lose predictability. As an extreme example, say the price of oil drops to $0 per barrel. Then, you have XLE as a percentage of SPY dropping dramatically not because of statistical fluctuations, but because of a fundamental shift, so you can throw statistics out the window.

Grant

That's always the question, has there been a fundamental change, or is it a fluke, that's why there are no true risk free investments. In the case of energy, I suspect that this may persist for a while, but it's still interesting to see this last blow to energy in a historical context.

Applying stats to the stock market is a classic example of the, "garbage in, garbage out" principle because we have to make huge simplifying assumptions. The hope is that the majority of the time a gross approximation will suffice, but it's still a gamble. I just try to remind myself that I'll miss 100% of the shots I don't take, and that nobody truly knows what will happen in the stock market.