U.S. stocks closed higher Wednesday, with materials and industrial stocks leading, as the Dow and S&P neared their 52-week intraday highs touched last summer.
The Dow Jones industrial average closed above the psychologically key 18,000 level for the first time since April 27. UnitedHealth contributed the most to gains.
"Perhaps investors are hoping and seeing opportunities for revenue growth and earnings growth," said Jack Ablin, chief investment officer at BMO Private Bank.
"The rationale for substantial gains from here seems kind of tenuous unless we can get a ramp up in revenue," he said.
Traders also attributed support to stocks from gains in oil prices and the weaker U.S. dollar. The U.S. dollar index hit its lowest since May 6 and was last about 0.2 percent lower, with the euro near $1.14 and the yen around 107 yen against the greenback as of 3:59 p.m. ET.
Industrials and materials led advancers on the S&P 500, which closed at a fresh high for the year so far and 0.64 percent below its 52-week intraday high touched last July. The Dow was 1 percent below its 52-week intraday high hit last June. Both indexes posted their third-straight day of gains.
"It's not as impressive when you say we were at those highs last year and we're right there now," said Ben Pace, CIO of HPM Partners.
The Dow transports closed up more than half a percent on the day, holding gains of more than 5 percent for the year so far.
"Transports continue to tell a story about the economy that's different from the mainstream," said Art Hogan, chief market strategist at Wunderlich Securities.
U.S. crude oil futures settled up 87 cents, or 1.73 percent, at $51.23 a barrel, its highest settle since July 15.
EIA data showed a draw of 3.2 million barrels in crude and builds in gasoline and distillate inventories. U.S. crude production edged higher, reversing a recent trend of declining output.
Late Tuesday, API reported a larger-than-expected U.S. crude stockpile draw, Reuters said.
"Maybe it's the rise in oil prices," said Peter Boockvar, chief market analyst at The Lindsey Group.
"I don't have any specific rational reason," he said of the gains in stocks, adding that "the underlying story that's being ignored is the continued reduction in growth and the decline in earnings."
"I think the market needs to consolidate around these levels. That's bringing in some selling around this time," said Peter Cardillo, chief market economist at First Standard Financial.
In economic news, the Job Openings and Labor Turnover Survey showed there were about 5.8 million job openings at the end of April.
The World Bank downgraded its 2016 global growth forecast to 2.4 percent from the 2.9 percent forecast in January.
"The investors already know global demand is already waning and is not that strong," said Adam Sarhan, CEO of Sarhan Capital, "but they're hoping the Fed and central banks are going to err on the side of easy money and eventually the economy will kick into gear. But that's a big hope."
Treasury yields traded lower, with the last around 0.77 percent and the 10-year yield near 1.70 percent.
The Treasury auctioned $20 billion in 10-year notes at a high yield of 1.702 percent. The bid-to-cover ratio, an indicator of demand, was 2.70, above a 10-auction average of 2.62. The share of indirect bidders was a record high 73.6 percent.
The German 10-year bund yield held off session lows, after earlier hitting a fresh record low of 0.033 percent, according to Reuters Tradeweb data going back to 1992. The European Central Bank began its corporate bond purchase program Wednesday.
"Investors are being forced into risk assets," Sarhan said.
European stocks closed lower, with the German DAX off more than half a percent and the STOXX Europe 600 down nearly half a percent. The STOXX Europe 600 Banks index closed more than 1 percent lower.
Asian stocks closed mixed, with the Nikkei 225 up 0.9 percent and the Shanghai composite off 0.3 percent.
China's May trade data released overnight showed imports fell 0.4 percent, the smallest year-over-year decline since turning negative in November 2014, Reuters said. Exports declined a more-than-expected 4.1 percent.
Crude oil imports jumped the most in over six years, with iron ore imports the highest since December, the news wire said. Copper purchases were up more than 19 percent.
The closed up 6.99 points, or 0.33 percent, at 2,119.12, with industrials leading eight sectors higher and telecommunications and energy the only decliners.
The Nasdaq composite closed up 12.89 points, or 0.26 percent, at 4,974.64.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, held steady near 14.
Gold futures for August delivery settled up $15.30 at $1,262.30 an ounce.
—Reuters contributed to this report.
On tap this week:
8:30 a.m. Initial claims
10 a.m. Wholesale trade
1 p.m. $12 billion 30-year bond auction
10 a.m. Consumer sentiment
2 p.m. Federal budget
*Planner subject to change.