Back to Posts
Listen to Thread

Curious if Quantopians are believers in the seasonal investing adage “Sell in May and go away” -- also known as the “I’ll take 12 months of returns for 6 months of risk thank you” strategy

As a discussion point, I have shared a simple strategy that toggles between holding equity (I chose SPY for parity with Quantopian’s benchmark) for the months of October thru April and holding bonds (I chose BSV because I’m partial to Vanguard) for the ‘summer’ months of May thru September.

Granted, this is an extremely simple, low frequency trade – yet it has been eerily on the mark the last few years. I’ve certainly seen historical studies that argue full equity exposure beats ‘market timing’ in the long run, but there also seems to be a compelling behavioral finance argument that ‘sell in may’ has become a self-fulfilling prophesy in recent years. Certainly it’s impossible to miss the seasonal spike in news coverage and online speculation. (side note: Google Trends search on “sell in may” is pretty entertaining).

At very least long cycles like this seem like a good case for dynamically weighting multi-factor models and/or looking for underlying predictors (macro factors, VIX, news?) to help inform asset allocation strategies.

I’d love to hear from the Quantopian community on how folks use/abuse/ or actively disbelieve in seasonality of market returns.

Clone Algorithm
283
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

That is fascinating. I'm going to have to check other months, now, and see if I can find other ones like this.

It's a curve fit probably, but a very good one. It would be lovely to see automated, randomised choices of start and end dates, but a few particular choices of dates confirms the adage for as far back as Quantopian's data go, as far as I can see.

Clone Algorithm
19
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

(The adage being "Sell in May and go away until St. Leger's day")

The only time there was a problem was in Oct 2008; if you ignore that and imagine you would have stopped yourself from buying into a hugely down-trending market, results are beyond-ridiculous good.

Clone Algorithm
36
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

@Dan: there is plenty of arguments for other months, too, but it's end of April / May that curve-fits ^GSPC best: http://sanzprophet.blogspot.co.uk/2012/12/seasonals-sp500-euro.html

...and these papers have decent coverage of this type of seasonality: http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2138547 and http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2115197 .

It is an amazing little adage. An article in S&C this month examines it yet again:
http://www.traders.com/index.php/sac-magazine/current-contents/feature-articles/45-classic-techniques/2070-sell-in-may-and-go-away

It's a "go away", not "buy bonds" approach, but amazing how much holding power this one has.

I've heard the adage a million times and like the results. But I'm curious does any one have any ideas of what is logically causing it to happen and where the flow of money goes?

Who is taking money off the table in such a big way, could it be hedge fund traders heading out to the Hamptons? or is it really just an unexplainable phenomenon.

i always thought it might correspond to year-end bonus season. depending on inudstry/position people get bonuses dec thru may. a corporate balance holds far less stock and more near-cash like investments than a retirement account. bonus season transfers money from corporate balance sheets to retirement accounts, so there is a net positive demand for stocks.

as a caveat, i have done basically nothing to test this hypothesis. i have some ideas on how to, but have never gotten around to it.

@Eric - there is no universally accepted consensus on the underpinnings of this 'seasonality effect' - also sometimes called the "Halloween indicator" - anymore than there is a consensus on whether it's fact or fiction. The two most commonly cited candidates that I've come across are seasonal variations in turnover volume and in AUM.

(1) seasonality in trading volume - basically your Hamptons hypothesis (interesting academic paper from mid 00s on the idea investors are "gone fishin'" in summer months). This study did also make an attempt to back out retail vs. 'smart money' participants based on trade sizes to try to see what investor class specifically is backing off - but they didn't observe a marked difference there.

(2) seasonality in investor flows - as @Scott suggests above - money flows into mutual funds are higher in Q1 driving demand and pricing in 9 months of expected returns in the first 3 months of the year.

I'd also point out that this is by no means the only seasonal anomaly out there - other fun variants that could be mocked up in Quantopian rather easily are:

  • Seasonal tax avoidance - harvesting capital losses in December drives selling pressure and pushes equity prices down
  • January effect - reinvestment drives buying pressure and pushes equity prices up
  • Turn of the month effect - institutional $ flows are higher at the start of month than end of month (micro version of 'sell in may') which drives outperformance in week 1 vs week 4 on a monthly basis.
  • Monday effect - increased selling pressure on Mondays (attributable to news cycle or the Office Space 'case of the Monday's' depending on your view)
  • window dressing effect - fund managers realign their portfolio in advance of transparency requirements so they're holding the prior quarter's winners - drives quarterly price momentum

Instead of taking data all the way back, use a 10 year seasonal time frame and step it forward. Also, use best weeks in a year instead of months. The results should be better. The reason behind a 10 year (You can justify other time frames) is that the market is dynamic and seasonal trends do shift.

So, now Jessica, do the opposite, for comparison, buy in May and Play in the Hay.

And then another study would be to split the year in half, and then clock like rotate the buy/sell months around. You know, buy Jan1, sell June 30; buy Feb 1, sell July 31, and so on and so forth. But do this for the nearly 20 years the SPY has been available.

@Anony Mole: why do you think the curve for Buy in May and Play in the Hay would be anything but terrible?

Clone Algorithm
6
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

@Pallas, I find I like to see the symmetry and confirmation of the expectation. When I test a strat, I often flip the buy/sells just to see that such a P&L curve performs as expected, that is, opposite (or nearly so) of the original buy/sell signals. Often times they don't mirror and I then have to dig into find out why. And, although I don't know that your curve is a direct opposite of your previous chart, they are not exactly mirror opposites. I wonder why. Thanks for the chart.

@Anony Mole - the dates were different. I ran it again with the same dates (and initial captial) as before; you can see the benchmark returns are (almost ?!) the same. Remember this strategy is invested at different times than "Sell in May..." and that as returns are re-invested (in both), there is no perfect symmetry to be observed in the return graph.

Clone Algorithm
6
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

This is my favourite algo on this site. How would it stack up if it did a sell and walk away, instead of reinvest into bonds?

how do i add picture in reply ,
any way ..
May-Oct avg returns 1.15% ranks at the bottom ( 12/12) for any 6 months period.
May-Oct , number of up periods are 62% again ranks at the bottom ( 11/11 , along with Apr-Sep)
May-Ocy , if returns are positive averaged at 6.77% again ranks at the bottom ..
from http://paststat.com/blog/sell-in-may-and-go-away-data-torture/

@Daniel Henry - that's my first reply

@Pallas, my mistake. I see it now!

Also, I read somewhere that election years are more stimulating for the economy. I wonder how holding on to the S&P on election years would look.

Sorry for the double post, but I made an attempt at reworking the algorithm to cater to election years. :)

Clone Algorithm
3
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

@Daniel, it's not entirely clear to me what logic you meant to express -- did you mean to only buy in October the year before an election year and sell in the May of the election year, or did you mean to buy in October and sell in may, but if the year is an election year don't change any positions (don't buy, don't sell, just stay in the market from the previous October's)?

The former doesn't do so well (see backtest). The latter, which it looks like is what you've implemented, seems to do quite well :)

Clone Algorithm
0
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

@Daniel I tried to implement your "sell in may (but not if it's an election year) and buy in october", and got almost the same numbers as you...it seems very good.

Clone Algorithm
3
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

@Daniel if you start in 2003 instead of 2002 you give the benchmark a head start of all that first three-quarters of 2004 rebound, and the benchmark actually wins. This is why real statistical analysis (see @Peter's paststat.com link) is going to be quicker than data-mining by running backtests :)

@Pallas, good observation. I backtested the algorithm again for every year from 2002-2011, and the results were as follows:

Year / Benchmark / Algorithm / Ratio
2003 / 97.09 / 79.84 / 0.822
2004 / 62.9 / 54.09 / 0.86
2005 / 55.88 / 54.09 / 0.968
2006 / 38.93 / 41.3 / 1.06
2007 / 20.64 / 24.92 / 1.207
2008 / 28.29 / 103.14 / 3.646
2009 / 84.29 / 103.14 / 1.224
2010 / 35.22 / 75.81 / 2.152
2011 / 17.39 / 46.29 / 2.662

It's hard to tell how an election would influence the algorithm, because the 2008 crash does wonders for a "Sell in May" type of investing. For that reason, I would consider 2008 as an outlier, and therefore, neglect its results. More data and tweaking would be needed before I would confidently infer anything. :)

edit: Though, omitting 2008, the data show a progression in the ratio (i.e. the algorithm seems to be increasing every year).

I'm not sure how to parse images, so here's a link to a graph:

http://i.imgur.com/LMXTNRm.jpg

Also, could someone explain to me why the "Sell in May, and walk away" strategy is, for lack of a better term, crapped on by almost everyone, while historically (since the very beginning of the S&P) it has been shown to outperform the hold-all-year-long strategy? I must be missing something here...

@Daniel - The efficient market hypothesis says this trend shouldn't exist, since it's quite predictable.

Hi everyone,

Thought you would find this economic seasonality piece in Institutional Investor interesting and perhaps relevant: http://www.institutionalinvestor.com/Article/3221085/Reading-Between-the-Lines-of-Seasonal-Economic-Data.html

thanks,
Jean

Log in to reply to this thread.
Not a member? Sign up!