TORONTO -- Rising commodity prices helped push Canada's main stock index to close slightly higher and push the loonie up, while U.S. markets climbed after encouraging economic data.

Crude rose for another day to hit a multi-month high on a combination of rising inventories and cut-backs in production, said Candice Bangsund, portfolio manager for Fiera Capital.

"Oil is rallying again today, at its highest level since November, after the Energy Information Agency this morning reported an unexpected decline in U.S. inventories, while there's also more indications that OPEC and its allies continue to adhere to those pledges for curbs to production."

The April crude contract closed up $1.39 at US$58.26 per barrel and the April natural gas contract ended up 3.6 cents at US$2.82 per mmBTU.

The rise in crude helped push the influential S&P/TSX energy index up 2.18 per cent on the day.

Higher crude prices also helped lift the loonie for a fourth consecutive day. The Canadian dollar averaged 75.04 cents US compared with an average of 74.75 cents US on Tuesday.

Overall, the S&P/TSX composite index closed up 13.31 points at 16,149.97 after hitting an intraday high of 16,212.56 on elevated volume of 270.1 million shares.

Cannabis stocks were the main cause of the uptick in volume as Aurora saw more than 50 million shares traded after announcing it had appointed U.S. billionaire Nelson Peltz as a strategic adviser. Hexo also brought further volume after announcing a takeover of the Newstrike Brands Ltd., the cannabis company backed by members of the Tragically Hip band.

The activity in the cannabis sector helped push the health care index up 2.49 per cent on the day. More conservative sectors including utilities and real estate saw declines.

In New York, the Dow Jones industrial average closed up 148.23 points at 25,702.89. The S&P 500 index was up 19.40 points at 2,810.92, while the Nasdaq composite was up 52.37 points at 7,643.41.

"The risk-on trade that we've been seeing all week here has essentially extended itself for a third day in a row, and this has largely been on the back of some stronger than expected economic data in both the US and the Euro zone," said Bangsund.

The market was up after U.S. economic data showed higher than expected orders of durable goods and business investment while inflation numbers continued to look contained, said Bangsund.

"Taken together, that's created a fairly compelling environment for risk assets, because you're getting stronger growth results, but not to the point where you're seeing a corresponding upswing in inflation."

Gold, while generally a risk-off trade, closed up on more confusion about the U.K.'s plans to leave the EU.

"Gold has popped above that US$1,300 mark, and looks to be on the back of ongoing Brexit uncertainty," said Bangsund.

The April gold contract closed up US$11.20 at US$1,309.30 an ounce and the May copper contract was up half a cent at US$2.93 a pound.