The stock market should have carried a warning in 2016: Steep drops and sudden acceleration may cause whiplash.

From crashing oil prices that fueled Wall Street's worst-ever start to a year, to unpredictable political events like Brexit and the election of Donald Trump, the year in stocks wasn't for the faint of heart.

Those who held on were rewarded handsomely: The resilient Dow closed 2016 more than 4,300 points above its January low of 15,451. A post-election surge, built around Trump's stimulus promises, has carried the Dow almost to 20,000 for the first time.

In the end, all three major indexes notched healthy gains in 2016. The Dow was up 13.4%; the S&P gained 9.5%; and the Nasdaq was up 7.5%. That's not bad considering both the Dow and S&P 500 suffered slight losses in 2015.

"This year we saw more sentiment flip-flops than we've experienced in a long time. The problem was that a lot of things didn't follow the script," said Michael Block, chief market strategist at Rhino Trading Partners.

Related: 5 stocks to buy in 2017

The bull market in U.S. stocks is on track to turn eight years old in March. The S&P 500 has more than tripled since President Obama's 2009 inauguration because of the economic recovery from the Great Recession and extremely low interest rates from the Federal Reserve.

But 2016 started scary. The Dow dived 1,079 points in the first week because of concerns about China's economic slowdown and plunging oil prices. The 6% selloff was the Dow's worst five-day start to a year on record.

Related: Trade war is Wall Street's top Trump fear

The panic ended. By mid-March, the Dow was up for the year, and the bull market was back on track.

Then the political shocks came. First there was the unexpected decision by British voters to leave the European Union. Brexit caused the British pound to crash and sent the Dow spiraling down 611 points in a single day.

U.S. stocks stabilized and coasted toward the November election. Dow futures plunged more than 900 points on election night as it became clear Clinton would lose unexpectedly. That reaction seemed to confirm predictions that a Trump victory would cause a stock market crash.

But the Trump selloff proved fleeting. Wall Street welcomed Trump with a bang, rising 257 points the day after his victory.

Optimism over his promises to slash taxes, roll back regulation and unleash infrastructure spending has carried the Dow nearly 1,500 points higher since the election.

"I would've thought you were crazy," Block said, "if you told me Trump getting elected would be greeted by a five-hour-long selloff, followed by a six-week rally."

Related: Trump rally could hit speed bump in 2017

But is the Trump euphoria overdone? Some, including even Trump adviser and activist investor Carl Icahn, argue the rally has gotten out of hand and it may be time for a breather.

After all, Trump hasn't even taken office yet and there's no guarantee his stimulus proposals will be enacted or be effective.

Others fear Trump's anti-trade campaign rhetoric will turn into protectionist policies and trigger a destabilizing trade war.

"The U.S. stock market has run pretty far, pretty quickly," said Chris Zaccarelli, chief investment officer at Cornerstone Financial Partners.

"Fundamentals need to catch up to expectations," he said.

--CNNMoney's Heather Long contributed to this report.