An article in the New York Times this weekend (along with the significantly increased volatility of U.S. equities during the past few days) got me thinking more about market dynamics, and I thought I'd try to replicate (as closely as possible with the resources and time I've got today) the results of the Times.
The illustration the Times made was that cumulative equity investment returns over the past 20-25 years can be disproportionately attributed specifically to the overnight gains in asset value (as opposed to intraday increases). The Times presented a plot of cumulative returns of the SPY exchange-traded fund (ETF) (NSEEARCA:SPY) since its inception (around 1994) in two different flavors:
1) assuming the shareholder had bought shares of the ETF at market open and sold at market close every business day; and
2) assuming the opposite scenario: that the shareholder had bought near market close every day and sold at market open.
Although it may not be news to those familiar with inter- and intraday equities trading, over the lifetime of the SPY ETF, there has been a substantial advantage to holding overnight. I found this kind of surprising! To have a look at the phenomenon myself, I loaded up my Quantopian account (www.quantopian.com) and did some of my own backtesting.
Below, I've copied-and-pasted results of Jan 2002-Jan 2018 investment strategies matching the two schemes above (Quantopian's backtesting routine won't let me go all the way back to 1994). Although the timeframe here is somewhat different than that presented by the Times, we see similar results: an exclusively overnight long position in SPY seemed to present a distinct advantage over an exclusively daytime hold.
Figure 1. Simulated returns of an initial $100,000 invested in the SPY ETF in January 2002, ending in January 2018. Here, as many shares as possible of the ETF are purchased right before every market close and sold again at the next business day's market open. Although returns with this strategy are somewhat less than a simple buy-and-hold, we can see that the shareholder did indeed enjoy most of the index's gains (141% cumulative return in the overnight strategy vs. about 209% for buy-and-hold). No commissions were accounted for in this simulation or any others in this post.
Figure 2. Simulated returns of an initial $100,000 invested in the SPY ETF in January 2002, ending in January 2018. The strategy in this example is the opposite of the one whose results are shown in Figure 1: here, shares are bought at market open and sold at market close. Over the ~16 year period here, the shareholder still makes gains in equity, but not nearly to the extent seen above.
After seeing these results, I thought it'd be neat to check out how the overnight edge manifested in a couple of other cross-sections of market history. For the first section, I thought I'd rerun the two backtests above on the interval between January 2002 until January 2010 (shortly after the financial crisis late in that decade). These results are shown below.
Figure 3. "Overnight edge" strategy backtested on the SPY ETF between Jan 2002 and Jan 2010. The strategy did pretty well here vs. the index benchmark (also SPY)!
Figure 4. A market-day-exclusive alternative to the overnight edge strategy is tested here on the SPY ETF between Jan 2002 and Jan 2010. Statistics of this run (seen in the printout) are significantly worse than the overnight strategy across the board.
The overnight strategy simulation really performed well during this earlier time period! Finally, I thought I'd test both strategies out on the span between Jan 2010 and Jan 2018. My results are below.
Figure 5. Jan 2010-Jan 2018 backtest of the overnight edge strategy on SPY.
Figure 6. Jan 2010-Jan 2018 backtest of the daytime strategy on SPY.
In this more recent timeframe, a significant amount of cumulative equity gains seem to start shifting toward intraday market dynamics (though the overnight gains still appear to have an edge in this particular simulation). I wonder: what factors in action during the more recent bullish market might have caused such a shift? And how can I best incorporate today's overnight gap trends and correlations into an efficient trading algorithm?
The article and results certainly gave me a lot to think about, and I'll share more algorithmic trading results soon!