The dropped over 6.5 percent in May as President Trump ratcheted up trade war threats, the worst month for the stock market since December when the index dropped over 9 percent.

Escalating trade tensions with China and Mexico continue to hang over the market, and an inverted yield curve has worried investors that a recession could be on the horizon.

Entering June, three of 11 S&P sectors were sitting in correction levels — declines of 10 percent or more from recent highs.

But stocks have reversed this week. On Tuesday, the market turned in its second-best day of the year with more dovish signals from the Federal Reserve and Republican leaders on Capitol Hill indicating resistance to Trump's threatened Mexican tariffs. The market was trading in the green again on Wednesday.

Market history dating back three decades suggests that investors should not be feeling overly confident in the bounce off the big May decline.

The summer is a seasonally weak period for stocks and June, in particular, has posted poor performance over a long period of time.

Over the past 30 years, the S&P 500 has traded positively in the month of June only 55 percent of the time. And it has lost an average of 0.49 percent, according to a CNBC analysis of Kensho, a machine learning tool used by Wall Street banks and hedge funds to identify potential trading profits from analysis of market history.

The Dow Jones Industrial Average fares a bit worse, a negative trade 60 percent of the time, losing an average of 0.85 percent.

The Nasdaq is even-money, trading positively 48 percent of the time, eking out a gain of 0.44 percent.