Wall Street stocks finished modestly higher Wednesday as a rally in petroleum-linked shares offset the hit from weak Chinese economic data.
After a choppy session that began with deep losses, the Dow Jones Industrial Average finished the session with a 0.1 percent gain at 23,346.24.
The broad-based S&P 500 also edged up 0.1 percent to 2,510.03, while the tech-rich Nasdaq Composite Index rose 0.5 percent to 6,665.94.
Markets began the first session of 2019 on a vulnerable note, with major indices shedding more than one percent after Chinese data showed manufacturing activity experiencing contraction in December for the first time in more than two years. 
But Wall Street got a lift in the afternoon following a Bloomberg News report that Saudi Arabia cut its oil output. The report boosted oil prices and petroleum-linked equities.
US stocks are coming off of the worst year in a decade, and the worst December for the S&P 500 since 1931, a distinction that has troubled President Donald Trump, who had previously touted a series of stock market records as evidence of his effectiveness.
Trump called the December pullback as a ‘glitch’ during a Cabinet meeting on Wednesday, predicting the market would surge after a trade deal is reached with China. Talks with Beijing are ‘coming along very well,’ he said.
But IHS Markit said the stock market decline was a factor in cutting its forecast for US growth for 2019 through 2022. And IHS said in a note it could cut forecasts further if the US government shutdown drags on.
Among individual companies, shares of Tesla Motors dived 6.8 percent after the electric car maker delivered fewer vehicles than expected in the fourth quarter.
Petroleum-linked companies rose with oil prices, with Dow member Chevron winning 1.7 percent, Apache 3.2 percent and Schlumberger 3.1 percent.