Stocks on Wall Street gave up early gains Tuesday, the latest swing in a volatile stretch shaped by investors’ concerns over a slowing global economy and the prospects for a solid trade truce between the United States and China.

Stocks in the United States rose sharply in early trading, after China’s commerce ministry said that officials in Beijing and their counterparts in the United States had discussed the next stage of trade talks between the two countries.

“Both sides exchanged views on putting into effect the consensus reached by the two countries’ leaders at their meeting, and pushing forward the timetable and road map for the next stage of economic and trade consultations work,” the ministry said on its website.