Donald Trump is the U.S. president-elect after his stunning win on Tuesday over Democratic rival Hillary Clinton. That is not how many had predicted this race for the Oval Office would play out, and in fact, polls indicated that Clinton would eke out a narrow victory.

On Wednesday, the Dow Jones Industrial Average DJIA, -1.64% closed up 256 points to trade about 40-points shy of its all-time closing high, while the S&P 500 index SPX, -1.94% finished 1.1% higher, while the Nasdaq Composite Index COMP, -2.60% ended at 1.4%.

On Thursday, stocks continued to forge a path higher, with the Dow hitting a fresh all-time record, though it is retreating somewhat in late-morning trade.

Read: How the stock market performs on, and after, Election Day

Also read: President Trump puts Obamacare’s future up in the air

The initial reaction was decidedly negative, but short-lived. Dow futures US:YMZ6 plunged nearly 800 points as the race turned in Trump’s favor late Tuesday and in the early hours of Wednesday. Some market pundits had predicted that the S&P 500 would crash, shedding half its value. and that the dollar would get obliterated, in the event of a Trump victory.

Indeed, the market actually fell when Trump was seen as gaining ground in the polls after the reopening of the Federal Bureau of Investigation’s probe into Clinton’s use of a private email server.

So what’s behind the lurch higher? Here are a few theories:

Uncertainty principle

The market hates uncertainty. That includes the twists and turns of this contentious election. So, when the market lost ground on the email scandal by the FBI and vaulted higher after the bureau’s Director James Comey said the probe was concluded without charges, investors were really reacting to the resolution of uncertainty, speculated Chris Zaccarelli, chief investment officer of Cornerstone Financial Partners, which manages $1.2 billion in assets.

Clean sweep

The stock market prefers the idea of a clean sweep, with Republicans winning the House, the Senate and the White House. Investors might view a Democratic sweep as onerous, but see a Republican lock as good news for the economy and the stock market.

Fiscal stimulus

Trump reiterated his intent to ratchet up spending and deliver sweeping tax cuts. Many economists and market participants view fiscal stimulus as a more practical way of lifting stocks higher, after a lengthy period of diminishing returns from central-bank monetary policies.

Reasons to be bullish

The bitterly fought race has obscured how well the economy and the stock market have held up. In fact, the S&P 500 on Wednesday traded above its 50-day moving average for the first time in weeks. Moving averages are viewed as dividing lines that point to short-term and long-term trends.

Crash is yet to come

Maybe, the market is still digesting the prospects of Trump in the White House. And so many uncertainties loom Perhaps investors will nose dive at some future point when his policies crystallize in investors’ eyes. Some speculated that hedge funds and other investors were unwinding wrong-footed bets that supposed a Trump loss, helping to drive risk assets higher.

Read: How stocks have performed between Election Day and inauguration since 1928

“I’m definitely surprised the market bounced back so quickly,” said Zaccarelli, who pointing to the U.K.’s decision to exit from the European Union as the model investors were bracing for in light of the surprise election outcome. On that day, back in late June, the market traded lower for two days before rebounding to recapture all of its lost gains.

How the market reacts longer term depends “on if Donald Trump reaffirms some of his policies that appear more economically risky,” said Brad McMillan, chief investment officer at Commonwealth Financial Network, in a note to clients Wednesday.

“How he deals with [the North American Free Trade Agreement] for example, could either reassure markets or rattle them further. He will face considerable pressure to start putting policy specifics in place very quickly” McMillan wrote.

Check out: Canada’s immigration website crashes as Trump’s chances rise