U.S. stocks closed mixed after a day of wavering between small gains and losses.

The relatively stable trading Tuesday came a day after a plunge in China’s main index set off a bout of selling in global markets.

At the close of trading on Wall Street, the Dow Jones industrial average was up 9.7 points, about 0.06 percent, at 17,158.7. The Standard & Poor’s 500 index gained 4.1 points, about 0.2 percent, to 2,016.7. However, the Nasdaq composite gave up 11.7 points, about 0.2 percent, to 4,891.4.

CRUDE ENERGY: At the close, the price of U.S. benchmark crude oil fell 96 cents, about 2.6 percent, to $35.80 a barrel in trading on the New York Mercantile Exchange.

ON THE MOVE: Ford fell 2 percent and General Motors fell 3 percent after the companies reported sales figures that fell short of forecasts.

Gun makers rose after new data pointed to strong sales at the close of 2015. Smith & Wesson jumped 11 percent and Sturm Ruger gained 7 percent.

OVERSEAS MARKETS: Chinese shares shrugged off government efforts to prop up the country’s sputtering stock market. “There’s more easing ahead from the Chinese,” said analyst Shane Oliver, head of investment strategy in Sydney at AMP Capital Investors Ltd., which oversees about $115 billion. “I expect them to cut interest rates and or the reserve-requirement ratio again. We’ve been reminded that volatility in financial markets remains high and that the global economy still needs monetary policy support.”

advertisement | advertise on newsday

A 7 percent slump in mainland China shares on Monday triggered a trading halt there on the first day of business in 2016. The rout, which spread throughout Asia, Europe and the U.S., was sparked by weak factory data in China and fueled by unrest in the Middle East.