The age-old market mantra "sell in May and go away" warns investors of the typically volatile May-through-October period for stocks.
There's only one problem. It doesn't hold up to the hard data.
Instead, a better mantra may be "stay in May and sell in June."
Using Kensho, a tool designed to quantify historical market events, we tested the traditional strategy by looking at the returns from May 1 to October 31 over the last 20 years. The index has, in fact, traded positive 60 percent of the time during that period. If you had followed the guidance, you most likely missed out on some market gains.
It's been a wiser strategy to wait a little longer to sell, and return to equity markets a little sooner.
The period from June 15 to October 15 has been a deeper, more reliable summer trough over the last two decades. During that period, the S&P 500 has traded negative the majority of the time and lost more than 1.5 percent on average.
Using those dates as our guide, we looked for assets that have historically bucked the summer downtrend. Oil and the utilities sector tend to outperform while Apple, Celgene, Nasdaq OMX and Monster Beverage are some of the names that have seen consistent, large average returns from June 15 to October 15.
There's also the flip side — the period of "investable" months.
The "sell in May and go away" strategy suggests investors return to stocks in November and hold until the following April. Indeed, the S&P 500 has traded positive 80 percent of the time and returned 6.5 percent on average since 1996.
However, the revised dates — buying back into markets in mid-October and holding until the next mid-June — has been a more profitable strategy. During this period the S&P 500 has traded positive 85 percent of the time and returned more than 8 percent on average.
So as you're planning your summer vacation this year, make sure you plan for your portfolio too, and get the right dates for the best strategy.
DISCLOSURE: NBC Universal, the parent company of CNBC, is a minority investor in Kensho.