NEW YORK — Elections have consequences for financial markets. But what that means for investors is often hard to predict.

Just look at France, where the threat of electoral losses for the president’s centrist party recently sent the French stock market to its worst week in more than two years. Or India, where questions about the margin of victory for Prime Minister Narendra Modi’s party sent Indian stocks from a gain of 3.4% to a plunge of 5.7% and back to a gain of 3.2% over a wild three-day span this month.

“Elections have consequences,” strategists at Morgan Stanley wrote in a recent report. “But when it comes to identifying those consequences for financial markets, it’s easy to mistake noise for signal.”

Around the world, from Mexico to South Africa, surprising election results have rocked markets recently. And more is likely to come, with over half the world’s population heading to the polls throughout 2024, according to BlackRock Investment Institute.

Approaching soon is July’s election in the United Kingdom. Later this year, the U.S. presidential election in November will unleash its own volatility on markets. It all adds up to a lot of uncertainty for financial markets that notoriously hate it.

The biggest aftershocks have shaken countries’ stock markets, but it’s in the traditionally sleepier bond market where the larger threat may lie. That’s because many of this year’s surprise wins are leading to speculation that the victors may push for more spending by governments, without raising more in revenue to pay for it.

Looser fiscal policies could make it more difficult for governments to repay their debts. Skittish investors are demanding fatter interest rates before lending to governments.

In the upcoming U.S. elections, the bond market could remain calm in a scenario where no party sweeps the White House and both chambers of Congress, said Niladri “Neel” Mukherjee, chief investment officer of TIAA Wealth Management. But if one party wins control, making it easier to dictate fiscal policy, it could mean sharp jumps for U.S. Treasury yields in the bond market. That in turn would make mortgages more expensive, increase the possibility of a recession and hurt stock prices.

One challenge for investors is the difficulty profiting from or protecting against electoral results. That’s because financial markets are shifting based on who’s leading the poll. To get ahead of them, an investor would need to know what the surprise result is that markets are not anticipating.

A GOP win in November, for example, could make higher tariffs and broader restrictions on trade more likely, which could boost the fortunes of U.S. manufacturers. But their stock prices would already be rising ahead of November whenever traders saw Republicans gaining in the polls. And even if an investor were to correctly guess a win by Republicans, in a scenario where the rest of the market was leaning otherwise, that investor would also need to know when those trade policies would take effect to make maximum profit.

That’s a lot of things to get right.