The old stock market adage “sell in May and go away” is part of the “Best Six Months” strategy that has become legendary on Wall Street, and it basically means the best time to hold Dow Jones Industrial stocks is from Nov. 1 to April 30, and then switching into fixed income the other six months.

This strategy has dramatically outperformed the market from May 1 to Oct. 31, though not as strong recently, as the Dow has been up between May and November in five of the past six years.

Though, the overall strategy has paid off huge historically.

An investor putting $10,000 in the S&P 500 between May 1 and Oct. 31 from 1950 to present would have just $4,138, a loss of $5,862.

By comparison, an investor putting $10,000 into the S&P 500 from Nov. 1 to April 20 over the same time period would have a staggering gain of $2,836,350.

Yes, you read that right: $2,836,350 in gains for one period vs. a loss of $5,862 in the other.

Per CNBC:

“Thus far we have failed to find a similar trading strategy that even comes close over the past six decades,” said Jeffrey Hirsch, who runs Stock Trader’s Almanac. His father, Yale Hirsch, discovered this “Best Six Months” strategy back in 1986.

What could possibly account for this outperformance? First, there are still clear seasonal trends in market trading, particularly around the summer.

“It falls during a time when traders and investors prefer the golf course, beach or pool to the trading floor or computer screen,” Hirsch said. “Trading volume can decline throughout the summer and then, in September, there’s back-to-school, back-to-work and end-of-third-quarter portfolio window dressing that has caused stocks to sell off in September, making it the worst month of the year on average.”

October is traditionally a bad month for stocks as well, which Hirsch says is likely due to the Oct. 31 mutual fund deadline. Once the fourth quarter hits, end-of-the-year strategies drive stocks.

“Institutions’ efforts in the fourth quarter to beef up their numbers can help drive the market higher, as does holiday shopping and an influx of year-end bonus money,” he said. “This is followed by the New Year, which can tend to bring a positive ‘new-leaf’ mentality to forecasts and predictions and the anticipation of strong fourth- and first-quarter earnings and drives the market higher into the second quarter.”

As he has many times in the past, Hirsch emphasizes that “sell in May” does not necessarily mean May will be down, or that the six-month period will be down.

“We are not the ‘sell in May’ people, we are the ‘reposition in May’ people,” he said. “The point is that most of the market’s gains occur November through April and that the market tends to drift sideways and is more prone to sell-offs and bears May-October.”

Hirsch, in fact, is fairly bullish about the short-term prospects for the market. “The market will most likely drift higher on the bullish GDP, earnings backdrop and the dovish Fed,” Hirsch said. “Plus it’s the preelection year, and that is the best of the four-year cycle up 15.8% for DJIA and 28.8%.”