* TSX ends down 0.3% at 30,275.76 * Materials group loses 3.2% as gold falls * Technology adds 1.2% * MEG's shares gain 3.3% as takeover fight ends (Updates at market close) By Fergal Smith TORONTO, Oct 27 (Reuters) - Canada's commodity-linked main stock index edged lower on Monday as the price of gold pulled back below $4,000 per ounce weighing on high-flying metal mining shares. The S&P/TSX composite index ended down 77.31 points, or 0.3%, at 30,275.76 even as U.S. markets notched gains. Gold fell 2.9% to about $3,992 per ounce as signs of a thaw in U.S.-China trade tensions reduced some of the bullion's safe-haven appeal. As recently as October 20, gold touched a record high of 4,381.21. "We've got a classic pullback on gold and the base metals and silver," said Greg Taylor, chief investment officer at PenderFund Capital Management. "The materials sector, which has helped the Toronto market higher most of the year, is taking some profits." The materials group, which includes metal mining shares, lost 3.2%, with shares of Agnico Eagle Mines Ltd down 5%. Industrials were also a drag, falling 0.5%. Technology was among the bright spots, adding 1.2%. Heavily weighted financials were up 0.6% and energy ended 0.5% higher. The price of oil held on to much of last week's strong gains, settling 0.3% lower at $61.31 a barrel. Oil sands company Cenovus Energy has struck a deal with rival Strathcona Resources that will see the smaller company vote its shares in favor of Cenovus' bid for MEG Energy MEG.TO, ending a bitter takeover fight that has been the talk of the Canadian oilpatch for months. MEG's shares added 3.3%, Strathcona was up 2.9% and Cenovus ended 0.3% higher. Wall Street's main indexes posted record closing highs as investors were hopeful about the prospects for a U.S.-China trade deal and looked forward to a week packed with high-profile technology earnings and a widely expected U.S. interest rate cut. The Bank of Canada is also expected to lower interest rates this week, with the policy decision set for Wednesday. (Reporting by Fergal Smith in Toronto and Ragini Mathur in Bengaluru; Editing by Vijay Kishore) (The article has been published through a syndicated feed. Except for the headline, the content has been published verbatim. Liability lies with original publisher.)