(This article was first published in October and updated on Wednesday to reflect the election result)

It’s the elections, stupid!

Many investors are so focused on headline-grabbing issues like global growth and Fed interest rate policy, they’re missing two key election themes telling us it’s time to overweight stocks. Consider these compelling data points.

1. Stocks do amazingly well after mid-term elections.

Since 1950, the S&P 500 jumped 16%, on average, in the six months following midterms. The market was green following all 16 of them, points out Bob Doll, chief equity strategist at Nuveen Asset Management.

Since 1928, the market advanced 7%, on average, and it’s been positive 86% of the time in the three months following midterms, notes Barclays Capital strategist Jonathan Glionna.

Why is this? Markets hate uncertainty, and elections remove uncertainty, says Doll. It doesn’t matter which party wins.

Also read: A breakdown of how the market performs after midterm elections

2. Stocks perform great in the third year of a presidential term.

That’s next year. On average, the stock market has gone up over 18% in the third year since 1950, compared to about 11% for the next best year (the fourth year), says Doll. This happens because presidents are trying to pump up the economy to sway the next election, speculates Marshall Nickles, an economics professor at Pepperdine University.

Layer on a few bullish trends — economic growth continues to improve, low inflation gives the Fed room to hold off on rate hikes, and lower gasoline prices are fattening wallets — and now seems to be a good time to be in stocks, concludes Bruce Bittles, chief investment strategist at brokerage firm Robert Baird.

How might this outlook go wrong? Past patterns don’t always repeat. The sample size here is small. Plus, market breadth was narrow in the recovery off October lows, suggesting a retest could be in order before stocks move higher, says Bittles. Still, the backdrop looks bullish.

Winners and losers with a Republican Congress: That’s the big picture. Of course, certain sectors do better or worse depending on which party wins.

Here’s my take on this: There’s a 70% chance Republicans will take the Senate, and control Congress.

This will benefit energy sector stocks Canadian Natural Resources CNQ, -5.34% and Peabody Energy BTU, -1.59% ; Boston Scientific BSX, -1.97% in medical devices; and Fannie Mae FNMA, -0.49% . It could be bad for refiners like Valero VLO, -3.92% and Tesoro US:TSO. We’ll get to more winners and losers in a moment.

Also read: Republicans retake Senate in wave election

But first, remember that a Republican Congress vs. a Democratic White House won’t mean total gridlock by default.

Both sides may be open to compromise to get what they want. After all, Republicans want to show accomplishments ahead of the 2016 presidential elections, and the White House probably wants to pump up the economy ahead of those elections.

Also read: Get ready for 2016

And even with just a slim majority in the Senate, Republicans can defuse filibusters on budget-related matters by using a legislative tool called “reconciliation,” which limits Senate debate time, points out Lawrence McDonald, the head of U.S. macro strategy at Newedge and author of “A Colossal Failure of Common Sense.”

Here’s a quick tour of some of the winners and losers, in a Republican victory scenario.

Oil producers and refiners: Republican victory may pave the way for expansion of the controversial Keystone Pipeline connecting Canadian oil sands to U.S. refiners and the Gulf of Mexico. Or it might increase the perception that this is likely.

This would benefit energy companies with oil-sands exposure like Canadian Natural Resources, Canadian Oil Sands CA:COS and Cenovus Energy CVE, -4.25% , says McDonald. It would also benefit U.S. refiners like Valero and Philips 66 PSX, -5.14% because of their ability to process low-grade Canadian oil sands, he says.

But be careful with those refiners.

Republican control of Congress might bring an end to U.S. export restrictions on domestic oil, in place since the 1970s oil shock, points out Glionna at Barclays. “The export ban is considered antiquated given the U.S. shale revolution and reduced reliance on foreign oil,” says Glionna. “An end of the ban could hurt refiners like Valero, Tesoro, HollyFrontier HFC, -3.95% and Western Refining US:WNR, says Barclays.

Natural gas and coal: Restrictions on liquid natural gas (LNG) exports may also be eased following a Republican Senate victory. That would benefit U.S. domestic natural gas producers, of course. But the play with bigger upside might be coal producers, says McDonald.

That’s because greater LNG exports would take natural gas off the U.S. market and lift natural gas prices. This would put a bid under coal, an alternative to natural gas at power plants. A Republican Senate victory may provide regulatory relief for coal producers, which would also boost their stocks, says McDonald. Coal companies are widely despised by investors, which makes them a great contrarian play now.

Coal producers he likes as a play on these themes include Peabody Energy, Cloud Peak Energy US:CLD, CONSOL Energy CNX, -1.14% , Hallador Energy HNRG, -0.73% and Alpha Natural Resources US:ANR. Two with interesting insider buying recently include Cliffs Natural Resources CLF, -9.28% and Arch Coal ACI, +2.14% , which I recently suggested in my stock newsletter, Brush Up on Stocks. Another option is Market Vectors Coal ETF KOL, +1.57% .

Medical-device companies: The medical device tax is one of the more controversial provisions of the Affordable Care Act. But Washington has been reluctant to tinker with it. That may change with a Republican Senate victory. A repeal of this unpopular tax would benefit medical-device companies like Boston Scientific, says Doll. Others that stand to gain include Medtronic MDT, -3.58% , Johnson & Johnson JNJ, -2.20% and St. Jude Medical US:STJ.

Housing sector: Republican control of Congress will likely bring a shareholder-friendly overhaul of reform efforts targeting Fannie Mae and Freddie Mac FMCC, +0.25% , says McDonald. A Republican Senate victory could put Sen. Richard Shelby, a Republican from Alabama, in charge of the Senate Banking Committee. Shelby is a strong supporter Fannie and Freddie, so this would help their shareholders, says McDonald. Congress may also pare back the Federal Housing Finance Agency’s role in mortgage insurance, which would help mortgage insurers like Radian RDN, -2.63% and MGIC M, -5.03% , says McDonald.

At the time of publication, Michael Brush had no positions in the stocks mentioned in this column. Brush is a Manhattan-based financial writer who publishes the stock newsletter Brush Up on Stocks. Brush has covered business for the New York Times and The Economist group, and he attended Columbia Business School in the Knight-Bagehot program.