TORONTO -- Canada's main stock index posted another flat day Wednesday even though the key energy sector gained on a rise in the price of oil.

The S&P/TSX composite index closed up 6.39 points to 16,074.30, after hitting an intraday low of 15,990.30. The index gained just 10.88 points on Tuesday.

"We aren't getting a lot of incremental macro news other than what we are seeing with the escalating tension between India and Pakistan," said Anish Chopra, managing director with Portfolio Management Corp.

Several energy stocks gained, pushing the sector 0.6 per cent higher on an unexpected decrease in U.S. oil production and Saudi Arabia stating it plans to stick with its plans to reduce oil output.

The April crude contract was up US$1.44 at US$56.94 per barrel and the April natural gas contract was up 0.3 of a cent at US$2.80 per mmBTU.

Chopra said that movement was helpful to the energy sector and resulted in gains by some big energy names, including Imperial Oil, Suncor Energy Inc. and Canadian Natural Resources.

Technology also rose on increases to Shopify Inc. stock and financials on corporate reports from Quebec-based banks National and Laurentian.

Materials lost 1.3 per cent on a big drop by Turquoise Hill Resources Ltd. and weakness by some gold companies, including Yamana Gold Inc., Goldcorp Inc. and Barrick Gold Corp.

The April gold contract was down US$7.30 at US$1,321.20 an ounce and the May copper contract was up 1.2 cents at US$2.96 a pound.

The Canadian dollar traded at an average of 76.07 cents US compared with an average of 75.79 cents US on Tuesday.

U.S. markets were mixed after U.S. Trade Representative Robert Lighthizer said that "much still needs to be done" before the U.S. and China can reach an agreement.

Chopra said Lighthizer framed his remarks that there will be long-term challenges with any trade deal.

"But when you look at the tone of what's come out of Washington or the U.S., it's generally been more positive, including from President Trump over the last while," he said.

In New York, the Dow Jones industrial average was down 72.82 points at 25,985.16. The S&P 500 index was down 1.52 points at 2,792.38, while the Nasdaq composite rose 5.21 points at 7,554.51.