* Stock index rises 30.12 points, or 0.24 pct, to 12,830.03 * Energy stocks lead the way, financials also strong * Consumer staples weak By Cameron French TORONTO, March 15 (Reuters) - Canada's main stock index ended higher on Friday on the back of surging energy stocks and a slight gain in financials, but the market just missed notching its fourth-straight weekly gain due to steep losses earlier in the week. The upward momentum was largely due to the 1.09 percent rise in the energy subgroup, which benefited from a slight rise in oil and natural gas prices and touched its highest level since early November. Analysts said the group is showing signs of breaking out of the range it has been stuck in. "There was some worry about some of the big producers, but now it appears they're paring back some of their large-scale programs, so their stocks are starting to look a little more interesting, and that's given some impetus to the market," said John Ing, president of Toronto-based Maison Placements. Penn West Petroleum was among the group's leaders, rising 5.2 percent to C$11.89, while larger player EnCana Corp climbed 1.5 percent to C$20.73. All told, five of the TSX's 10 subgroups ended the session higher, including the heavily weighted financials sector, which notched a 0.13 percent rise. Power Financial Corp climbed 1.2 percent to C$30.19, rebounding from losses earlier in the week, when the holding company reported a weaker-than-expected fourth-quarter profit. Toronto Stock Exchange owner TMX Group Ltd gained 2.5 percent to C$56.75. The S&P/TSX composite index ended the session up 30.12 points, or 0.24 percent, at 12,830.03. Friday's gain reversed the TSX's recent trend of underperformance versus comparable U.S. indexes as both the U.S. S&P 500 index and the Dow Jones industrial average took losses on the day. However, for the week, the TSX slipped 0.04 percent due to a steep 1 percent slide on Wednesday, while U.S. markets made gains over the five-day period. "The (Canadian) market is stuck in trading range. People are waiting for some sort of news either that the recovery is going to be robust or in fact we're slipping into recession," Ing said. "Until we get some something conclusive, you're going to see this trading range." Economic data on Friday was mixed, as U.S. industrial production data was stronger than expected, while Canadian figures showed slower housing activity and Canadian consumer indebtedness holding at record levels.. Among declining groups, consumer staples fell 0.31 percent, as food retailers took modest losses. Empire Co Ltd, parent company of grocer Sobeys, fell 1.3 percent to C$63.58, while competitor Metro Inc slid 0.9 percent to C$63.14.