Canada’s main stock index racked up its third straight day of losses on Wednesday as oil and gold prices lost ground, while U.S. markets finished mixed.

The S&P/TSX composite index was down 61.92 points to 15,967.72, with the technology sector leading decliners. Shares of Shopify Inc. tumbled $10.09, or 7.03%, to $133.40 at the closing of markets.

The materials and metals sectors also finished in the red, as the February gold contract declined US$13.00 to US$1,286.20 an ounce and the March copper contract gave back US3¢ to US$3.07 a pound.

Surprisingly, the energy sector was one of few advancers on the commodity-heavy TSX, despite a sharp drop in oil prices as the January crude contract fell 69¢ to US$57.30 per barrel.

“It is perplexing if crude prices are down and energy stocks are up,” said Candice Bangsund, a vice-president and portfolio manager at Fiera Capital in Montreal.

“It happens sometimes perhaps when the sell-off in energy prices has been overdone, and obviously people maybe look at that as a buying opportunity in the energy space which is maybe unfairly depressed.”

Bangsund said crude prices “are really in defence mode” ahead of OPEC’s meeting in Vienna on Thursday.

“You’re just seeing some lingering uncertainty about whether OPEC and Russia are going to be able to reach that agreement on extending productions cuts next year,” she said.

It was reported last week that the 14 nations of the Organization of the Petroleum Exporting Countries and Russia have agreed to extend their latest cuts in oil production until the end of 2018. OPEC and a group of other important oil producers will meet in Austria’s capital on Thursday to discuss cuts they announced one year ago and implemented at the start of 2017.

Weakness in gold, said Bangsund, can be attributed to encouraging developments in the United States. The Commerce Department reported Wednesday that the U.S. economy grew at an annual pace of 3.3% from July through September, the fastest rate in three years. U.S. investors were also encouraged by news Tuesday that a Senate committee has cleared the way for a tax reform bill to go before the full Senate.

“When taken together that’s setting the stage for higher interest rates in the U.S. and of course that’s negative for gold,” Bangsund said.

A steep drop in technology companies south of the border also pulled major U.S. stock indexes mostly lower on Wednesday, offsetting gains in other sectors. Amazon, Facebook, Google parent Alphabet and other big technology companies were giving up some of their recent gains.

“In the technology space we’re seeing some profit taking today, no specific news just some pretty broad-based selling,” Bangsund noted.

On Wall Street, the Dow Jones industrial average advanced 103.97 points to 23,940.68, a record high, while the S&P 500 index edged down 0.97 of a point to 2,626.07 and the Nasdaq composite index fell 87.97 points to 6,824.39.

In currency markets, the Canadian dollar was trading at an average value of US77.80¢, down 0.28 of a U.S. cent against a strengthening greenback.

Elsewhere in commodities, the January natural gas contract was up US5¢ at US$3.18 per mmBTU.

With a file from The Associated Press