"My job is to write the exact same thing between 50 and 100 times a year in such a way that neither my editors nor my readers will ever think I am repeating myself," Wall Street Journal columnist Jason Zweig once wrote. 

The reason, he said, is because markets are always changing, but good advice rarely does. "And while people need good advice, what they want is advice that sounds good." This makes it irresistible for pundits to pander to whatever the market is doing, playing off the news and reacting to every headline. 

This goes into overdrive when a new party wins an election. That happened last week, when Republicans took control of the Senate.

Two radio stations asked me this week for my take on how you should invest with Republicans now leading the Senate.

I declined both, because here's the truth: There is no evidence that you should change your investments based on what party controls the government.

Pundits love to pander about what an election means for your investments, but taking what they say seriously consistently comes at the expense of your wealth.

There are two hilarious things about this topic. One is that most election-based investment advice makes a lot of sense – it seems rational, well thought-out, and a-political. The other is that it's almost always wrong.

I spent a day digging through news archives to see what pundits advised during past elections. It's disturbing.

During the 1992 election, a popular argument was that Bill Clinton's proposed remake of the U.S. healthcare system would be disastrous for pharmaceutical stocks. "What has clouded their appeal for many investors lately has been the prospect of major political change for health-care businesses, especially if Gov. Bill Clinton wins the presidential election next month," the Santa Cruz Sentinel wrote in Oct. 1992. The overhaul never happened, and by the end of Clinton's presidency pharmaceutical companies were some of the most valuable companies in the world. Pfizer (NYSE:PFE) increased 791% during Clinton's presidency. Amgen (NASDAQ:AMGN) surged 611%. Johnson & Johnson (NYSE:JNJ) popped 385%. Merck (NYSE:MRK) jumped 299%. Those crushed the market, with the S&P 500 rising 251% from January 1993 to January 2001.

During the 1994 election, analysts cheered on tobacco stocks as the incoming Republican congress was "not likely to pursue hearings into the huge tobacco industry, as a Democratic-led Congress would have," wrote Prudential. The regulations did come, and tobacco stocks lagged the market for the next six years. From 1994 to 2000, Altria (NYSE:MO) gained 57% while the S&P 500 nearly tripled in value.

During the 1996 election, pundits pointed to a powerful historical trend. "Studies have shown that small stocks usually fare better under Democratic administrations and bigger stocks fare better under the Republicans," the News Tribune wrote. "So, the message is clear: If Bill Clinton wins, think small; if Bob Dole wins, think big." Clinton won, but the opposite trend took place. From 1996 to 2000, the small-cap Russell 2000 rose 54% while the large-cap S&P 500 jumped 131%.

During the 2000 election, Newsweek wrote that if George W. Bush wins, the ensuing tax changes could "help banks, brokers and other investment firms." By the end of Bush's second term, the KBW Bank Index had dropped almost 80%. The article also recommended pharmaceutical stocks thanks to Bush's light touch on regulation. The NYSE Pharmaceutical Index lost nearly half its value during Bush's presidency. Another popular piece of advice was to purchase airline stocks if Bush won, because "a broad tax cut ... has the tendency to increase discretionary spending," as one analyst put it. By 2005, four of the six largest U.S. airlines were bankrupt.

During the 2002 election, "Investors are likely to make money on drug, insurance, defense, and energy stocks as a result of the Republican election victory," wrote the Atlanta Journal-Constitution. By the next election, the S&P 500 was outpacing two of those four sectors, no better than a coin toss.

During the 2004 election, CNNMoney wrote that a Bush win would again be good for financial companies. "Financials and asset-management firms could gain as well because the president is perceived to be more market-friendly and has proposed creating new private Social Security investment accounts." By the end of 2008, financial stocks had lost more than 80% of their value, on average.

During the 2008 election, many predicted that an Obama victory would be a win for green energy like solar and wind and a loss for big oil. "Based on his campaign promises, alternative energy companies may be happy. Oil companies may be less so," said NPR. The opposite happened: The iShares Clean Energy ETF is down 51% since then, while Chevron (NYSE:CVX) is up 110%. Another popular theme was that an Obama administration would be bad for bank stocks, with new regulations looming. Many bank stocks are up fivefold or more since then.

During the 2012 election, Fox Business wrote that if Obama wins, "home builders such as Pulte and Toll Brothers could see increased demand for new homes due to a continuation of the Obama Administration's efforts to limit foreclosures, keeping homeowners in their existing properties." Their shares have underperformed the S&P 500 by 26 percentage points and 40 percentage points since then, respectively.

I'm not pointing these out to make fun of pundits. The most important point here is that all of these predictions made sense. They seem rational. They're not fanatical partisan cries, or angry rhetoric. But all of them were wrong.

There is a tendency for investors to do single-variable analysis, and say, "If A, then B." If we have a president that subsidizes green energy, then green energy stocks will do well. But things never work that way -- they are always more complicated. China may flood the market with cheap solar panels. Or solar stocks might be wildly overvalued. Or the companies may be horribly run. On the list of variables that determine stock returns, whether a Democrat or Republican works in Washington is near the bottom of the list, bordering on totally irrelevant.

Buy good companies. Don't pay a lot for them. Hold them for a long time. Do that no matter what party wins an election. That's good advice that should be repeated, rather than pandering to the news.

For more:

Check back every Tuesday and Friday for Morgan Housel's columns.

More from The Motley Fool: Warren Buffett Tells You How to Turn $40 into $10 Million