Strength in the technology sector helped offset losses in energy stocks to leave Canada's main stock index with gains Wednesday alongside U.S. markets.

The S&P/TSX Composite Index closed up 62.25 points, 0.31 per cent, at 20,282.26.

In New York, the Dow Jones Industrial Average ended up 95.96 points at 34,194.06. The S&P 500 Index was up 23.68 points at 4,027.26, while the Nasdaq Composite was up 110.91 points at 11,285.32.

The Canadian dollar traded for 74.67 cents U.S. compared with 74.65 cents U.S. on Tuesday.

The January crude oil contract was down US$3.01 at US$77.94 per barrel and the January natural gas contract was up 30 cents at US$7.71 per mmBTU.

The December gold contract was up US$5.70 at US$1,745.60 an ounce and the December copper contract was up less than a penny at $3.62 a pound.