TORONTO (Reuters) - Canada’s main stock index rose on Monday as an almost three-week high for gold helped boost gold mining stocks, while a major railway company advanced after it scrapped a takeover bid.

A man walks past an old Toronto Stock Exchange (TSX) sign in Toronto, June 23, 2014. REUTERS/Mark Blinch

The most influential movers on the index included Barrick Gold Corp ABX.TO, which rose 6.5 percent to C$21.04 as gold rallied, and Canadian Pacific Railway Ltd CP.TO, which advanced 2.6 percent to C$179.91.

CP said it had scrapped efforts to buy Norfolk Southern Corp, almost six months after launching an unsolicited $28 billion bid for the fourth-largest U.S. railroad operator.

However, the index was unable to sustain a move above its 200-day moving average as some gains were pared before the start of U.S. earnings season after the close.

“It seems like some investors are maybe booking some profits ahead of that (U.S. earnings),” said Youssef Zohny, portfolio manager at StennerZohny Investment Partners.

“Canadian investors are going to be watching U.S. bank earnings, it is probably the strongest correlation to Canadian bank earnings,” he added.

The Toronto Stock Exchange's S&P/TSX composite index .GSPTSE closed up 26.03 points, or 0.19 percent, at 13,422.76. Just three of the index's 10 main groups ended higher.

The materials group, which includes precious and base metals miners and fertilizer companies, added 3.4 percent despite losses for major fertilizer producers Potash Corp POT.TO, off 1.4 percent to C$20.49, and Agrium Inc AGU.TO, down 0.4 percent at C$113.57.

Gold futures GCc1 rose 1.1 percent to $1,256.4 an ounce.

Industrials rose 0.5 percent.

U.S. crude CLc1 prices settled at $40.36, up 1.6 percent, helped by a U.S. government forecast that said U.S. shale oil production is expected to fall in May for a seventh month in a row.

However, the energy group ended just 0.1 percent higher amid investor caution ahead of an oil producers meeting in Doha on Sunday.

The financials group dipped 0.1 percent, with Brookfield Asset Management Inc BAMa.TO falling 1.6 percent to C$42.49.

The shares of Valeant Pharmaceuticals International Inc VRX.TO remained volatile, tumbling 7.8 percent to C$40.43 after briefly trading above $50 last week.