TORONTO -- Canada's main stock index set a new record high Wednesday as a deceleration in reported cases of the COVID-19 virus set off a rally led by the key energy and materials sectors.

The S&P/TSX composite index gained 67.02 points to a record close of 17,925.36 after hitting an intraday high of 17,933.21.

"There does seem to be general consensus that the coronavirus is decelerating, has slower growth in cases and China is saying they've got a much better handle on it," said Michael Currie, vice-president and investment adviser at TD Wealth.

"The World Health Organization isn't quite ready to say they've got it contained but it's generally feeling that way."

In New York, the S&P 500 and Nasdaq composite both hit record highs, while Dow Jones industrial average climbed 115.84 points at 29,348.03. The S&P 500 index was up 15.86 points at 3,386.15. Nasdaq rose 84.44 points at 9,817.18 after shares of Tesla Inc. surged 7.28 per cent and chip maker Nvidia Corp. was up 6.4 per cent.

The risk-on behaviour comes days after warnings from Apple Inc. and other companies had suggested a possible slowing of the global economy.

"But this has got people a bit more optimistic that it won't be as bad as they think and it's had a huge effect on oil," Currie said in an interview.

Crude oil prices rose for a seventh consecutive day on an expected increase in Chinese demand with a waning virus. Another factor was the imposition of U.S. sanctions on a Russian state-controlled brokerage that has helped the Venezuelan government skirt an American oil embargo and enabled President Nicolas Maduro to keep his grip on power in the South American country.

The April crude contract was up US$1.20 at US$53.49 per barrel and the March natural gas contract was down 2.6 cents at US$1.96 per mmBTU.

The energy sector gained 2.2 per cent as Crescent Point Energy Corp. and Canadian Natural Resources was up 4.1 and 3.3 per cent respectively.

Materials rose more than 1.1 per cent with Kinross Gold Corp. up 4.25 per cent as gold prices hit their highest level in nearly seven years.

The April gold contract was up US$8.20 at US$1,611.80 an ounce and the March copper contract was up 0.2 of a cent at US$2.61 a pound.

"It's kind of unusual to see oil, gold and stock markets having big days all at the same time," Currie said.

Gold is seen as a safe haven, and while retail investors are increasingly jumping from gold into equities, institutional investors are a little more cautious about following suit until coronavirus improvements are confirmed, he said.

Health care was the biggest loser on the day but it wasn't taken lower by cannabis producers. The sector was hampered by a 6.2 per cent drop in the shares of Bausch Health Companies Inc. as it reported a loss of nearly US$1.52 billion in its latest quarter as it settled a lawsuit over a stock plunge that hit investors in 2015.

The Canadian dollar traded for 75.58 cents US compared with an average of 75.43 cents US on Tuesday.

Canada's inflation rate hit 2.4 per cent in January, its fastest pace of inflation in almost two years. The increase -- which exceeded analyst expectations -- will likely have an impact on the Bank of Canada's interest rate decision next month, said Currie.

"So that would certainly put any brakes on talk of a rate cut."