United States stocks turned positive toward the end of trade, but the gains weren’t enough to make up for a plunge in markets after China’s main index fell sharply Monday.