This is what the stock market could do if Donald Trump loses

The stock market is betting on an election outcome that could mean political inertia and more gains ahead.

If the stock market doesn't get its favorite election outcome this year, it may get its second best and that would be a scenario where no party holds Congress and the White House.

BMO Private Bank CIO Jack Ablin said the betting market is giving high odds to a Hillary Clinton win for the White House but also a Democratic Senate — the second best scenario for stocks. While that would be a Democratic president and a Democratic Senate, the odds on PredictIt.org and other sites favor the Republicans retaining control of the House of Representatives. That would be a recipe for more gridlock in Washington, which the stock market typically likes.

"Going back to 1900, the Dow tends to perform better under Democratic presidents, outpacing their Republican rivals 8.4 percent to 6.1 percent average annual price return. The Republicans have an investment edge in the Senate, however, outperforming the Democrats 8.1 percent to 6.5 percent. Of the four combinations of President and Senate, a Democratically-controlled White House matched up against a Republican Senate yields an 11.2 percent average annual return," Ablin said in a note. "If PredictIt is right, we're setting up for the second best investment scenario with an average annual return of 7.5 percent historically."

Ablin said Clinton and the Democrats are gaining in the polls, and the PredictIt.org website that lets participants bet on outcomes gives Clinton a wide margin. According to the site Tuesday, she had an 82 percent chance of winning. The New York Times snapshot of latest polls shows Clinton winning over Republican Donald Trump, 46 percent to 40 percent.

"The investment markets concur. Since September 26th, the Mexican peso, a real time indicator of Trump's political prospects, rallied 6.6 percent against the U.S. dollar, reversing a 13 percent slide that commenced last April. Meanwhile, biotech, candidate Clinton's political piñata, has sagged versus the Nasdaq. Biotechs slid eight percent relative to the Nasdaq since late September, reflecting Clinton's improving chances," Ablin wrote.

Ablin said PredictIt.org odds for the Republican party holding the majority in the Senate were just 32 percent, but the Republicans should continue to control the House of Representatives, with PredictIt suggesting 80 percent odds for a GOP majority. If Democrats looked set to win the House, stocks could buckle under on fears of more regulation and unfriendly tax proposals.

The polls however are not showing that, but Ablin noted that the polls and betting forums are not perfect. "I will say for the Brexit vote, the betting sites had 85 percent chance of Britain remaining before Brexit. But who knows," he said. The U.K. voted by a slim majority to leave the European Union by a slim margin.

"The markets certainly like Democrats in the Oval Office. It's almost by a factor of two to one," he said.

"I think those stats that I described are priced in," he said. "So if things change from the current path, we should get some volatility. I don't think the peso has rallied as much as it should … it could recover more," he said. The peso sank and short positions rose when Trump was edging higher in the polls. But lately, Clinton has added to her lead, since the second debate. There is a third and final debate Wednesday night.

The biotechs have taken a hit, and they reflect gains by Clinton, who is expected to be tough on drug pricing. "The questions is, is it just campaign rhetoric or is there something real there? I think there's something real there. Hillary Clinton has had her sights set on health care" since the 1990s, he said. "I think maybe concerns about the banks are overdone, but I think health care, I think those concerns are legit."

Trump's calls that the election are rigged raise concern that there could be a noisy challenge after the outcome is learned.

"I think the question is what happens to Donald Trump after the election ... does he continue on rattling things? ... There's a lot of people that are dissatisfied with the economic conditions."

The betting odds and polls show the House of Representatives remaining in Republican hands, but the market has reacted negatively to speculation that the Democrats could sweep Congress.

Even if the Senate switches to Democratic control, the party is not seen winning a 60 vote majority, and the outcome would still be one of the market's favorite scenarios with a GOP House — a recipe for more Washington gridlock.