South Africa’s rand and stocks gained on Wednesday in line with other emerging markets as hopes the United States and China could reach a trade deal boosted risk sentiment.

At 1511 GMT, the rand traded at 13.8700 versus the greenback, 0.7% firmer than its previous close.

Stocks were broadly in the black, helping the country’s benchmark index end the session more than 2% higher.

The rand’s gains were linked to growing optimism that the world’s two largest economies will strike a deal to avoid an all-out confrontation that would severely disrupt global trade, said Halen Bothma, a market analyst at ETM in Johannesburg.

“Market is still very much interested in a few big themes, one is the Fed, one is trade talks between China and the US and the third, I would say, is global growth,” he said.

Officials of the United States and China continued trade talks in Beijing for an unscheduled third day, amid signs of progress on issues including purchases of US farm and energy commodities as well as increased access to China’s markets.

On the bourse, the JSE Top-40 index ended 2.2% higher at 47,140 and the broader All-share index picked up 2.03% to 53,222.

In fixed income, government bonds also firmed, with the yield on the benchmark instrument maturing in 2026 down 1 basis point to 8.750%.