Canada's main stock index was little changed on Wednesday, hovering below a recent record high, as losses for industrial and telecommunication shares offset gains for resource stocks, which were boosted by higher commodity prices.

The Toronto Stock Exchange's S&P/TSX composite index closed down 3.07 points, or 0.02 per cent, at 16,073.58.

Intraday gains for the index stalled just below its all-time high of 16,131.79 on Nov. 7.

The telecommunications group fell 0.8 per cent, while industrials dipped 0.2 per cent as Ritchie Bros. Auctioneers Inc (RBA.TO) retreated 2.7 per cent to $32.46.

Five of the index's 10 main groups were in negative territory.

The energy group, which accounts for almost a fifth of the index's weight, climbed 0.4 per cent as U.S. crude prices reached US$58 for the first time since July 2015.

U.S. crude oil futures settled up 2.1 per cent at US$58.02 a barrel.

The largest percentage gainer on the TSX was NexGen Energy Ltd (NXE.TO), which rose nearly eight per cent to $3.38.

The move higher for oil was in part due to TransCanada Corp cutting crude flows from Canada into the United States. TransCanada (TRP.TO) fell nearly two per cent to $62.99.

The materials group, which includes precious and base metals miners and fertilizer companies, added 0.5 per cent.

Gold prices rose as the dollar fell on technical factors and weak U.S. economic data, and gold jumped more after the U.S. Federal Reserve released minutes of its latest meeting.