But the companies that move goods through a humming economy now look among the market's best bargains, as long as the U.S.-China trade dispute doesn't derail their outlook.

Railroad and trucking stocks took a hit starting in late January just like the rest of the market. From its record high on Jan. 26, the S&P 500 slumped more than 10 percent in less than two weeks to enter a correction, and the S&P 1500 road and rail index <.SPCOMRAR> fell 9.1 percent.

Demand to move U.S. goods by rail, truck and ship, however, has held firm so far this year. So the shippers emerged from the tumult sporting some of their cheapest valuations in years thanks to an atypical phenomenon: as their share prices were falling, their earnings expectations were moving up sharply - meaning their price-to-earnings ratios fell by an even wider margin.

"The volatility we saw in the first quarter was actually a pretty healthy thing for the entire market, it kind of reset expectations, it kept excess valuations from bubbling up," said Eric Marshall, portfolio manager and Director of Research, Hodges Capital Management in Dallas, Texas.

That valuation reset may mean more upside for these stocks than the market as a whole if earnings reports in the coming days validate those optimistic profit forecasts.

"Now that it has occurred, people have gone back in, re-evaluated the fundamentals and you are starting to see those stocks work their way back up off of a base," Marshall said.

J B Hunt Transportation may provide investors with a template of what to expect.

The trucker's shares fell more than 13 percent between late January and early April. But its forward P/E ratio slumped by twice that margin, 27 percent, contracting from 27.2 to 19.8, below its five-year average of 21.5.

By comparison the full S&P 500's P/E ratio contracted by about 12 percent to 16.3, and still sits above its historic average of 15.1.

The stock surged more than 6 percent in the wake of its earnings on Monday, its best day in five years. Nine of the analysts tracking the stock have raised their price targets since then.

(Graphic - JB Hunt Forward PE now in-line with 5-yr average, https://reut.rs/2JS4Iw1)

On the rail side, CSX Corp saw its forward PE drop from 22.02 in mid-January to 16.05 on Feb. 8, well below its five-year average of 19.9. Its shares rose nearly 8 percent on Wednesday, its best day in six years, following its quarterly results to send the stock to a record closing high of $61.01.

(Graphic - CSX Corp Forward PE and Price, https://reut.rs/2HgRyXH)

A big concern, however, is an escalation of the current trade dispute between the U.S. and China, which was a primary cause of the recent downturn in the group.

"If you are looking at it in a quite linear focus, you think it would affect the rails probably because they move a lot of exported goods and they are susceptible to what goes on in trade," said Lindsay Bettiol, analyst at Atlantic Equities in London.

The United States imposed a 10 percent tariff on aluminium imports on March 23 along with a 25 percent duty on steel imports. U.S. President Donald Trump called for the tariffs to protect U.S. metal makers from cheap imports.

A strengthening economy, however, is likely to overpower those concerns and shipping companies are primed to benefit.

In a recent note to clients, Morgan Stanley noted its TLFI index, which measures the incremental supply and demand for Dry-Van Truckload services, has done better than its typical performance for this time of the year despite a decline over the past two weeks.

The index is projected above levels last seen in 2014, but below the fourth-quarter of 2017. When a given reading is above a prior year's level, it means there is more freight demand relative to available capacity, according to the firm.

(Graphic - Trucking Stocks Forward PE, https://reut.rs/2K1Yda3)

Earnings are expected at the end of April and early May from rail and trucking names such as Union Pacific, Norfolk Southern and Genesee & Wyoming as well as trucking companies Knight-Swift Transportation and Heartland Express. Each are currently at or below their two-year average forward PE.

(Graphic - Rail Stocks Forward PE, https://reut.rs/2JeJCH8)

While these stocks are poised to benefit from continued economic growth, they could also be susceptible to another bout of trade war concerns, even if they are relatively insulated to the global economy.

A Reuters poll of over 500 economists worldwide showed the global economy will race further ahead this year, expanding at its fastest pace since 2010, but trade protectionism has the potential to derail that momentum.

"These stocks will see bigger up days and bigger low days but over the long term the fundamentals will lay out," said Jim Corridore, equity analyst at CFRA in New York.

"Of course if the entire economy blows up because of trade wars, that is a risk that has to be thought about, but I just don’t see it happening at this time."

(Editing by Alden Bentley, Dan Burns and Edward Tobin)

By Chuck Mikolajczak