A broad-based rally pushed Canada's main stock index to close at a record high Wednesday, while the loonie dipped and U.S. markets were mixed.

The S&P/TSX composite index closed up 104.42 points at 16,420.95, topping its previous record of 16,412.94 set January 4, 2018.

The index also set an intra-day record, trading as high as 16,444.45 to eclipse the 16,421.42 point high from Jan. 4.

The Toronto market, which has seen fairly steady gains since late March, has been boosted especially by an oil price rally that has lifted the energy sector that makes up almost 20 per cent of the index, said Michael Currie, vice-president and senior investment advisor at TD Wealth.

Growth stocks such as Shopify Inc., Canopy Growth Corp., Valeant Pharmaceuticals International, all up 25 per cent or more, have also contributed, said Currie.

"They're generally more the growth names. You're not seeing the big dividend, safety, value-type names, they've been holding back a bit."

Cannabis stocks in particular saw a boost Wednesday, after Prime Minister Justin Trudeau said Canadians would be able to legally buy and smoke marijuana starting Oct. 17. Canopy was up more than six per cent, while Aphria Inc. and Aurora Cannabis Inc. were up more than four per cent.

But while the TSX hit a record, Currie said year-to date gains, where the composite index is up 1.3 per cent, don't compare that favourably to U.S. markets like the Nasdaq, up almost 13 per cent this year, and the S&P 500, up almost four per cent.

"We'll take the silver lining that it is positive, it is a record high, but it's not really surging, especially when you compare it to something like New York," said Currie.

"If you look at the world's developed markets, we're pretty much middle of the pack here for gains to date."

Canadian stocks have also been boosted lately from the dropping loonie, which is down almost two cents in the past week, said Currie.

"One of the at least positive effects is it makes Canadian stocks more appealing to foreign investors, because they're by definition cheaper."

The loonie has faced pressure from trade concerns over NAFTA negotiations, but its fall more attributable to increased favour for the U.S. dollar as the Federal Reserve raises rates amid a strong economy.

"It's not so much a case that people are anti the Canadian dollar, just there's a very, very strong move into U.S. dollars," said Currie.

On Wednesday, the loonie averaged 75.18 cents US, down 0.14 of a US cent.

In New York, the Dow Jones industrial average closed down 42.41 points at 24,657.80. The S&P 500 index ended up 4.73 points at 2,767.32 and the Nasdaq composite index was up 55.92 points at 7,781.51, a record high.

The August crude contract closed up 81 cents at US$65.71 per barrel and the July natural gas contract ended up six cents at US$2.96 per mmBTU.

The August gold contract closed down US$4.10 at US$1,274.50 an ounce and the July copper contract closed down a penny at US$3.04 a pound.