Midterm elections have historically preceded gains for stocks, regardless of who wins

How will Tuesday's midterm elections affect you? No matter which party wins, the most immediate impact may be on your investment portfolio.

Once the polls close, stocks have historically gone on to sizzle in the months following a midterm election. Not only have they risen more frequently than in other years of the presidential election cycle, the gains have also often been impressive. Analysts have different theories to explain the pattern, which has remained strong since the 1940s, but it's still unclear if the gains have a real cause or are just a coincidental quirk.

Regardless, the numbers are impressive. In the 90 days following a midterm election, stock returns have been positive 86 percent of the time since 1928, according to data compiled by Barclays Capital. That's a higher success rate than comparable periods of the election cycle. In the other three years, stocks have had positive returns 66 percent of the time in the 90 days following a general election.

The gains can also be strong. Stocks have had a median return of 6.7 percent in the 90 days following midterm elections, versus 2.4 percent for the other three years.

A longer-term investment has had an even higher success rate. In the 12 months following a midterm election, the Standard & Poor's 500 index has risen 100 percent of the time going back to 1946, according to S&P Capital IQ.

One possible explanation revolves around investors' distaste for uncertainty. After the midterm election is over, the belief is that investors will have a better sense of where government policies are headed. That could boost confidence, regardless of who wins, and thus demand for stocks.

That sounds reasonable, but it's probably not the main reason stocks jumped following the last midterm election in 2010. After Republicans picked up seats in the House and Senate, the S&P 500 went on to surge more than 9 percent in three months.

A more important factor may have been an announcement made on Nov. 3, 2010, a day after the midterm election, notes Barclays strategist Joseph Glionna. That's when the Federal Reserve announced a second round of bond buying to stimulate the economy.

So while the historical pattern is impressive, keep in mind that it's based on a relatively small sample size. That means it's a risky leap from saying that midterm elections have typically preceded rising stock prices to declaring that they cause the gains.