Canada’s main stock index closed lower Thursday despite a surge in the price of crude oil.

Markets were “whipsawed” in a volatile trading session that saw initial optimism about the trade dispute between the U.S. and Chinese falter later in the day as the Trump administration said China needs to do more to get a deal.

“The sentiment out there is just very fragile and so markets are trading basically on any headlines associated with the ongoing trade dispute,” said Candice Bangsund, portfolio manager for Fiera Capital.

The morning saw constructive developments as Chinese importers resumed purchases of U.S. soybeans and officials in China reported that they are in close contact with the U.S. administration and negotiating a broader trade agreement.

But the U.S. later poured cold water on markets by suggesting China has to do more to settle the dispute.

“It’s just a very temperamental market right now where the swings are quite drastic and the market’s just gyrating essentially on these headlines pertaining to the trade relationship between the U.S. and China,” she said in an interview.

The S&P/TSX composite index lost 32.71 points to 14,750.35 after reaching a high of 14,783.06 in morning trading.

Defensive sectors like utilities and consumer staples gained while health-care, industrials, technology, telecommunications and financials were down.

Energy was down slightly even though the January crude contract was up US$1.43 at US$52.58 per barrel.

Crude jumped on Saudi Arabia’s indication that it would curb shipments to the United States while U.S. inventories remain elevated and the International Energy Agency warning that global supplies could decline in the coming year because of disruptions out of Iran and Venezuela that almost equal OPEC production cuts.

“So this could have a huge impact on the supply picture and obviously this has sent oil prices higher today,” Bangsund added.

In New York, the Dow Jones industrial average was up 70.11 points at 24,597.38. The S&P 500 index was down 0.54 of a point at 2,650.53, while the Nasdaq composite was down 27.98 points 7,070.33.

The Canadian dollar traded at an average of US74.86¢ compared with an average of US74.93¢ on Wednesday.

The January natural gas contract was down US1.2¢ at US$4.12 per mmBTU.

The February gold contract was down US$2.60 at US$1,247.40 an ounce and the March copper contract was down 0.3 of a cent at US$2.77 a pound.