Wall Street has many traditions and proverbs, and many investors still pay close attention to them. One commonly quoted rule in spring is that investors should "sell in May and go away," selling their stock market investments and only buying them back in November. The idea behind this rule is that when you look at stock market history over the past 90 years, two of the three worst months come in May and September, while three of the four best months for the market come in December, January, and April. In addition, October is a month that's notorious for stock market declines, including the crashes in 1929 and 1987 and the worst of the financial crisis in the fall of 2008.

Yet selling in May hasn't worked well lately. When you look at how the Dow Jones Industrial Average (^DJI -0.29%) has performed, following the rule would have caused you to miss out on gains in four of the past five years:

Chart showing May to October returns for Dow Jones Industrial Average from 2013 to 2017

Data source: Yahoo! Finance. Chart by author.

With interest rates on cash investments at extremely low levels over that period, you would've been better off staying in stocks in all but 2015. Add to that the fact that selling and rebuying every six months will expose you to expensive short-term capital gains taxes outside a retirement account, and the strategy breaks down in a hurry.

It's tempting to look for ways to avoid losses when you invest, but adopting short-term seasonal thinking like the "sell in May" rule doesn't work well. You're better off taking a long-term view, seeking out stocks that will produce the best returns over the years and not worrying about what happens on a month-to-month basis.