(New throughout, updates prices and market activity, adds portfolio manager comments, details on energy stocks)
* TSX ends up 84.67 points, or 0.54 percent, at 15,669.07
* Index posts its highest close since Feb. 23
* Seven of the TSX's 10 main groups end higher
By Fergal Smith
TORONTO, April 4 (Reuters) - Canada's main stock index advanced on Tuesday to a nearly six-week high as gains in gold and oil prices helped boost the shares of mining and energy companies.
The Toronto Stock Exchange's S&P/TSX composite index closed up 84.67 points, or 0.54 percent, at 15,669.07, its highest close since Feb. 23.
Gains for the index came even as investors on Wall Street stayed on the sidelines ahead of first-quarter earnings season and remained cautious over President Donald Trump's ability to deliver on promises such as tax reform.
"Today serves as a good example of just how attractive the Canadian market is when global investors or domestic investors look around the landscape," said James Robertson, managing director, portfolio solutions group at Manulife Asset Management.
"We are getting a synchronized global recovery ... Canada is going to benefit from that overall economic growth."
Gold prices rose to a one-month high before paring some gains as Trump laid out aggressive plans for infrastructure spending and deregulation.
Expectations of a drawdown in U.S. crude and product inventories helped oil prices push further above $50 a barrel.
The materials group, which includes precious and base metals miners and fertilizer companies, added 0.8 percent, while the energy group climbed 1.5 percent.
Canadian Natural Resources rose nearly 2 percent to C$44.62 and Pembina Pipeline Corp ended up 2.1 percent at C$42.94 after announcing on Wednesday a dividend increase.
Seven of the index's 10 main groups ended higher, including a 0.9 percent gain for industrials as railroad stocks rose, while the heavyweight financial services group gained 0.2 percent.
Among the sectors that lost ground, consumer discretionary fell 0.4 percent, pressured by a 3 percent drop in the shares of automotive supplier Magna International Inc to C$54.45.
On Monday, major U.S. automakers' sales figures for March came in below market expectations and gave early evidence that America's long, robust boom cycle for car sales may finally be losing steam.
U.S. crude prices settled up 79 cents at $51.03 a barrel and gold futures rose 0.3 percent to $1,254.4 an ounce.
Canada swung to an unexpected trade deficit in February as exports tumbled by the most in nearly a year, suggesting economic momentum may have hit a speed bump and giving the Bank of Canada room to maintain its cautious stance next week. (Additional reporting by John Tilak; Editing by Meredith Mazzilli)