* TSX closes up 5.02 points, or 0.04 percent, at 12,220.45 * Resource stocks gains as commodity prices rise * Banks are main drag ahead of Fed, German court ruling By Alastair Sharp TORONTO, Sept 11 Canada's main stock index inched higher on Tuesday as rising oil prices kept energy stocks buoyant, while banks fell back ahead of a U.S. Federal Reserve decision and a key German court ruling on the legality of the euro zone's bailout fund. Stocks moved in a narrow 70-point range ahead of the two-day Fed meeting starting on Wednesday at which the central bank could launch a third round of bond-buying. "Whether we're up 20 points or down 20 points is really irrelevant. The next game in town is we're waiting for the Fed," said Levente Mady, a market strategist at Union Securities in Vancouver. "I'd be leaning more to the negative side heading into the Fed announcement," Mady said, adding that investors appeared to have already priced in positive news. The Toronto Stock Exchange's S&P/TSX composite index closed up 5.02 points, or 0.04 percent, at 12,220.45. "This is still a market that is in trepidation mode," said Andrew Pyle, a wealth advisor at ScotiaMcLeod. "It's a market with no conviction either way." Higher commodity prices helped many of the Toronto index's resource plays gain. Teck Resources Ltd jumped 5.3 percent to C$30.77 as copper hit a four-month high. Overall, energy companies were the brightest spots on the day, as crude oil prices rose in choppy trade. The energy and materials sectors account for more than 40 percent of the index and are among its worst performing parts so far this year. "These are two sectors that have lagged," Pyle said. "Much of what we're seeing now is a catch-up." Financial stocks, which have gained this year, came under pressure on Tuesday. Royal Bank of Canada slipped 1.1 percent to C$55.81 and Toronto Dominion Bank was down 0.8 percent at C$81.57. The resource-rich S&P/TSX composite index was boosted to four-month highs late last week after China said it planned a major spending spree and the European Central Bank unveiled a possibly unlimited bond-buying program. It pared some of those gains on Monday as investors awaited the Fed meeting and the German court ruling on the ECB plan. Legal experts believe Germany's Constitutional Court will approve the euro zone's bailout fund, while possibly imposing tough conditions that would limit Berlin's flexibility on future rescues.