Traders work on the floor at the New York Stock Exchange. (Andrew Kelly/Reuters)

The stock market resembles a locomotive as it heads into 2018.

Low interest rates, near-record employment, healthy corporate earnings, global economic strength and a mostly-business-friendly Trump administration that saw through an overhaul of the tax system has propelled the Standard & Poor’s 500-stock index to a more than 19 percent gain as measured by price. If your throw in dividends, the total return grows to more than 21 percent on the year.

Not bad, considering people were calling the early returns in 2017 a “Trump Bump.”

What happened?

Back up a few years.

“The global economy was depressed during 2015 by the plunge in the commodities industries around the world,” said Ed Yarden of Yardeni Research. “It didn’t cause a global recession, but it did cause a global slowdown. In other words, 2015 was a global synchronized mini-bust. ”

“Then 2016 was a global synchronized recovery from that bust,” Yardeni said. “And 2017 was the beginning of what turned into a global synchronized boom that lasts in 2018.”

Yardeni predicts the S&P 500 will hit 3,100 by the end of 2018. That’s a generous pop of 16 percent from present day. He expects a similar increase in the Dow Jones industrial average, a widely watched metric of 30 major U.S. companies that saw high-flying gains in 2017.

Yardeni and others say the present conditions, barring a war or other Black Swan event, offer a rare occasion when the stars are aligned for stocks. He said the push will come from rising earnings. But there are other salutary factors, as well.

“China has been providing an enormous stimulus,” he said. “They are pumping $2 trillion in increases in the bank loans the past 12 months. The Bank of Japan and the European Central Bank monetary policy remain very easy. Then, of course, there is a little circularity here. Rising stock prices have created rising wealth effect around the world. It all adds up to a remarkably good environment for earnings. It’s hard to picture a more bullish environment when you have the global economy growing at a good clip with no inflation.”

Barron’s recently published its annual outlook from its panel of 10 investment strategists, including Yardeni. The mean 2018 outlook for the Barron’s group came in at 2,840 for the S&P, with Yardeni’s prediction at the high end.

You cannot talk about the 2017 stock market without including the torrid returns of technology stocks, led by the so-called FANGs — Facebook, Amazon, Netflix and Google’s parent Alphabet.

They were all home runs. Amazon (whose founder Jeffrey P. Bezos owns The Washington Post), Facebook and Netflix all locked in gains of about 55 percent for the year. Alphabet was up more than 30 percent, and Microsoft was up 38 percent.

“They are generating lots of earnings by disrupting everyone else’s business models, forcing their competitors to become more competitive,” said Yardeni, calling it a “healthy development.” “The FANGs are likely to continue to lead our economy and stock prices higher.

Brad McMillan, chief investment officer for Commonwealth Financial Network, also sees the market at a sweet spot — at least for the first half of 2018.

“This is probably as good as it gets,” McMillan said. “The play right now is regulation. Republicans are going to continue to act while they can, and regulation will continue to get hacked away.”

That makes banks, and financial services companies in general, ripe for earnings increases going into next year. McMillan is also bullish on the energy sector, which has been beaten down over the past few years because of an oil glut. Oil gluts push the price of a barrel of oil downward, which also depresses the shares of oil companies.

The U.S. oil and gas industry has a friendlier relationship with the White House under President Trump, who has made a point of touting the industry ever since the 2016 campaign.

One sign of the love was the approval of the construction of the Keystone Pipeline, which McMillan called “the poster child for the change in regulations.”

“We were talking about financials and how they are going to benefit from less regulations,” he said. “The same is applying to energy companies.”

But there are other factors at work, including the Organization of the Petroleum Exporting Countries extending cuts in oil production into next year, placing demand more in line with supply.

“I started saying six to eight months ago that when you look at the gap between energy stocks and oil prices, energy stocks should go up. The question is, ‘Are energy prices going to stay where they are or move higher?’” McMillan said. “They will move higher. You are seeing the oil and gas industry, specifically in the U.S., move back toward oligopoly pricing.”

That said, McMillan doesn’t hold to Yardeni’s bullish scenario for 2018, summing up his forecast as: “A great first half and then people are going to start to sober up and sell off. A 2018 recession is possible and 2019 recession probable.”

“It’s a very highly priced market,” he said. “Even as earnings continue to go up, if valuations revert to more normal levels, we could see the stock market not appreciate at all in 2018.”

Washington investment manager Michael Farr put this this way: “The rule says ‘buy low.’  This isn’t low.  While many can make money by buying high and selling higher, it is a much riskier approach and quite inappropriate for important ‘nest egg’ type assets.”

McMillan expects the S&P 500 to level off at 2,700 a year from now, barely up from the airy 2,600s where it was pre-Christmas 2017.

He also worries about the low volatility in the stock market, which signals a complacency toward inherent stock risks.

“As you look at the percentage of investors who expect the market to go up, that’s very, very high,” McMillan said. “I have been giving a talk for over a year titled ‘1999 2.0,’” he said, referring to the dot-com bubble that exploded into a bear market. “When you look at the economic and market metrics, the similarities between this bull market and the dot-com bubble are remarkable.”

Another sign of a bubble, according to some experts, is the stunning rise in value of the cryptocurrency bitcoin, from about $1,000 in January to more than $18,000 in recent weeks before dropping back to $14,525 on Friday. Even casual investors have wondered whether they should clear out their savings accounts and jump in. Buyer beware, Farr said.

“If you really can’t afford to lose the money you have saved, then don’t put at risk,” Farr said. “It all seems so simple and logical until you hear your brother-in-law’s siren song of bitcoin profits that are in the 10s of thousands.

“Shame over having missed these great gains that even your stupid brother-in-law was able to figure out, and fear over missing out on this run away profit train can lure you from the reasonable and sober path,” he said. “Step off at your own risk.”

Investors have tuned out some sobering realities of the world, including North Korea testing ballistic missiles and the ever-present instability in the Middle East, the sabre-rattling around the world as well as the domestic political animosity between Republicans and Democrats.

“At some point, the market stops ignoring political events,” McMillan said.

Then look for the choo-choo to slow.

Read more: 

Buffett on bitcoin: ‘It will come to a bad ending’