The murky math of government gridlock

There's a theory floating around Wall Street that stocks do better when control of the federal government is split between parties. The idea is that gridlocked parties can't accomplish much. By getting nothing done, that's supposed to help stocks.

So is government gridlock actually good for the stock market?

It turns out it depends on how you define gridlock, and how deep you want to look for returns.

Take the most recent election, in November 2014. We got what should have been the perfect gridlock situation: A second-term Democrat in the White House and a Congress controlled by warring factions of Republicans.

Many market experts passed around the so-called obvious theory that this would be good for stocks. But the market went down as much as 10 percent since that election, and is still down today.

An analysis with market analytics tool Kensho gives more details. The market does jump right after a split government takes office. But that's only in the case of a Republican president with a Democratic Congress. Stocks are up almost 7 percent in the first month under that scenario. Remember, this is their first month in office, before they've had a chance to do much.

But when those officials are actually given time to work: Republican presidents with a gridlocked government have averaged just a 1 percent annual return.

If you want to cherry-pick good statistics to make the claim work, reverse it and say Democrat presidents with a gridlock government make the market go up. Sure, that average was 11 percent before this term started, but it certainly hasn't helped now.

Going further down the rabbit hole to find statistics, you can say the best combination for government is one with a Democratic president, a Democratic Senate, and a Republican House. But since World War II, that combination happened only once, starting in 2011. It's not enough of a trend to say anything legitimate about what's true, real and predictable in the future.

As the 2016 election moves forward, you'll hear this concept again and again: That a gridlocked government is good for stocks. But just remember, it may not be true.

Disclosure: NBCUniversal, parent of CNBC, is a minority investor in Kensho.