The Canadian stock market closed up on Tuesday as positive German data suggesting the European\'s largest economy will not slip into recession encouraged the market and led the financial and energy stocks higher. The benchmark S&P/TSX Composite index surged 51.89 points, or 0.42 percent, to 12,282.36 while S&P/TSX Venture Composite index dipped 2.81 points, or 0.24 percent, to 1,183.93. The mood among Canadian investors has substantially brightened on Tuesday as a key German economic index that gauges the opinions of German business experts rose stronger than expected. The Center for European Economic Research reported that the ZEW indicator of German economic sentiment rose to plus 6.9 points in December, from minus 15.7 in November. Markets had expected the index to rise only to minus 11.5. Germany\'s economy grew a modest 0.2 percent in the third quarter. On the economic front, the Canadian data was also encouraging. A report from Statistics Canada showed the Canada\'s trade deficit unexpectedly shrank in October as imports fell to a 15-month low while exports increased. All eight sectors on the Canadian stock market\'s main index were higher. The financial sector rose 0.65 percent, playing the biggest role among all sectors in leading the market higher. Royal Bank of Canada, the country\'s largest bank, gained 0.65 percent to 58.87 Canadian dollars per share. Another big gainer in this sector was Bank of Nova Scotia, the third largest bank in Canada. Its shares grew 1 percent at 56.50 Canadian dollars per share as boosted by investor optimism. The energy sector climbed 0.19 percent, helped by higher oil prices. The January crude oil contract on the New York Mercantile Exchange rose 0.5 percent to 85.95 U.S. dollars a barrel. Oil and gas producer Canadian Natural Resources rose 1.07 percent to 28.32 percent per share. Tech sector increased 2.05 percent. Patent licensing company Wi-LAN Inc said it filed a lawsuit against Blackberry maker RIM for infringing on a patent related to bluetooth technology. But Wi- LAN shares fell 8.16 percent as the company also said a U.S. appeal court ruled against it in a patent dispute. RIM shares added 5.8 percent to 12.42 apiece. In currency, the Canadian dollar continued to run up to trade at 1.0141 U.S. dollars at 5 p.m. local time (2200 GMT) on Tuesday, compared to 1.0139 U.S. dollar on Monday.