TORONTO -- The Toronto stock market powered ahead to a solid gain for a fourth straight session Tuesday, supported in part by a well-received earnings report from Canadian Pacific Railway and data that showed Chinese economic growth slid to a five-year low in the latest quarter but was within expectations.

The S&P/TSX composite index jumped 182.48 points to 14,520.25 as traders continued to snap up stocks beaten down over the course of a market sell-off that started last month. The selling pressure was ignited in part by worries about the state of the global economy and the impending end of a key stimulus measure by the Federal Reserve, its bond purchase program.

But analysts say it would be a mistake to think that the market's retracement has run its course and that indexes will resume going more or less straight up.

"You will see more volatility, bigger swings in the markets and more emphasis on the news that comes through," said Sadiq Adatia, chief investment officer for Sun Life Global Investment.

"(It will be) more of a see-saw environment. But we still think it's a see-saw heading upwards."

The Canadian dollar was ahead 0.52 of a cent to 89.14 cents US.

Data showing U.S. homes sold in September at their fastest clip this year helped send New York indexes sharply higher as the Dow Jones industrials surged 194.4 points to 16,594.07, the Nasdaq rose 88.71 points to 4,404.78 and the S&P 500 index gained 32.53 points to 1,936.54.

Canadian Pacific Railway's (TSX:CP) quarterly net income was up 23 per cent from a year ago to $400 million or $2.31 per share, missing estimates of $2.35 a share. CP also said that revenue came in at $1.67 billion, up nine per cent but missing estimates of $1.69 billion. The railway's operating ratio, a key efficiency metric, improved more than expected to a record low of 62.8. CP shares climbed $2.24 or 2.5 per cent to $223.89.

After the markets closed Monday, Apple Inc. reported quarterly earnings of $8.47 billion or $1.42 a share, beating estimates by 12 cents. The maker of iPhones, iPads and other products posted revenue of $42.12 billion, exceeding forecasts of $39.96 billion. For the current quarter, Apple expects revenue in the range of $63.5 billion to $66.5 billion. Analysts had expected revenue of $64.44 billion. Apple share rose 2.5 per cent.

Commodity prices also advanced Tuesday even as China's economic growth slowed to 7.3 per cent last quarter. That is lower than the 7.5 per cent rate that had been targeted by Chinese leaders, who are trying to steer China toward growth based on domestic consumption instead of overreliance on trade and investment.

But the number was broadly in line with expectations and higher than some estimates that had pegged growth at 7.2 per cent for the quarter.

Most TSX sectors advanced with the base metals sector in the lead, rising 2.2 per cent as December copper was ahead four cents to US$3.03 a pound.

The energy sector was up 1.45 per cent even as November crude erased early gains and declined 41 cents to US$82.30 a barrel.

The gold sector was the only decliner, down 0.7 per cent while December gold rose $7 to US$1,251.70 an ounce.

Meanwhile, McDonald's gave back 0.75 per cent as the world's biggest fast food chain reported quarterly adjusted earnings of $1.51 versus the $1.37 that analysts expected. But global same-store sales fell 3.3 per cent, greater than the 2.8 per cent slide that had been forecast.