There are a few reasons why the "sell in May" strategy often pays off, Stovall says.

“Sell in May and go away” is an old Wall Street adage that comes up every spring, based on the historical underperformance of stocks in the six months from May through October. But Sam Stovall, U.S. equity strategist at S&P Capital IQ, says investors would be much better off rotating out of certain sectors in May rather than going away, and then return to the broader index in November, and repeat.

In a recent webinar presented by S&P Dow Jones Indices, Stovall suggested that come May investors rotate out of the S&P 500 index — whether cap-weighted or equal weighted — or the S&P Small Cap 600 or S&P Global 1200 index and into consumer staples and health care sector indexes within the corresponding index, split 50-50, through October. In November they should return 100% to the broader benchmark until May, and repeat.

“Don’t sell in May and go away,” said Stovall. “But sell in May from the overall market and gravitate toward the more defensive areas of the market.” Not only are the returns greater with that strategy but the volatility is less, said Stovall.

In the 21-plus years between April 30, 1994, and July 31, 2015, the rotation strategy returned anywhere from 360 to 440 basis points more than the fully invested broader index strategy, according to Stovall.

The greatest outperformance was seen when rotating out of the Global 1200 index into the comparable health care and consumer staples indexes, which yielded a 10.2% annual return versus 5.8% if remaining fully invested in the broader index. The smallest performance gap was seen in the comparative performance rotating out of the traditional cap-weighted S&P 500 index (10.8%) versus sticking with the S&P 500 (7.2%).

This year the rotation strategy is also working “quite nicely,” says Stovall — yielding gains when the broader indexes have losses year-to-date.

When asked why such a strategy works well across various types of indexes, Stovall said the reason lies with capital flows into the market before May and the lack of inflows after that, especially during the summer.  Before May there are flows from pension funds, individuals funding 401(k) plans and IRAs—these investors have an April 15 deadline to qualify for tax deduction – and from individuals investing early tax refunds.

After May there’s the summer doldrums followed by what is traditionally the weakest month of the year — September – and window dressing by mutual funds before the end of their fiscal year, said Stovall. In addition, he said investment managers who aren’t usually prone to go into cash “hide out” in defensive sectors where demand for products and services remain” fairly static no matter what time of the year we’re in.”

–Related on ThinkAdvisor: