Canadian Pacific Railway Ltd. climbed to the highest level in eight months on earnings and a rebound in crude lifted energy producers to offset a slump in gold, as Canadian equities ended the day near the highest in a year. The S&P/TSX Composite Index rose 0.1 percent to 14,533.57 at 4 p.m. in Toronto. Trading volume was 5.9 percent lower than the 30-day average. Canadian stocks remain more expensive than their U.S. peers, with a price-earnings ratio of 22.4 for the S&P/TSX about 11 percent higher than the S&P 500. Canadian Pacific added 1.2 percent, closing at the highest level since December. The railroad operator reported second-quarter earnings that topped analysts’ estimates after reducing costs by cutting jobs and running longer trains. The railway stock drove a 1.9 percent gain in industrial shares as eight of the 10 main groups advanced. Energy producers rebounded as the price of crude erased losses to close 29 cents higher at $44.94 a barrel in New York. U.S. government data showed inventories dropped 2.34 million barrels last week, a record ninth straight decline. Canada is the second-best performing developed market in the world this year with a 12 percent advance, trailing only New Zealand. Mining stocks have fueled the resurgence, with a 53 percent increase amid a rebound in gold prices, the best such performance for the group in at least 30 years, according to data compiled by Bloomberg. The group slumped 3.9 percent Wednesday, the most since May, as copper led a drop among industrial metals. An advance in the dollar affects consumption as it reduces demand from other countries. Barrick Gold Corp. slumped 7.4 percent for the biggest drop among miners. Valeant Pharmaceuticals International Inc. added 4.6 percent for a third straight day of gains. The drugmaker got regulatory backing from the Food and Drug Administration for two new drugs.