Equity and bond market investors, so-called "real money," tend to have longer horizons than often-leveraged speculators betting on the direction of a currency. Increased buying of Canadian securities by foreign portfolio managers could leave the loonie more resilient should market sentiment turn bearish on the currency.

"Real money flows tend to be much less volatile," said Erik Nelson, a currency strategist at Wells Fargo in New York. "You become more confident (about the outlook for the currency), because it is less likely for these guys to pull their money out on short-term headlines."

Foreign investment in Canadian securities rose to C$52 billion ($40.8 billion) in the third quarter from the second quarter on the back of two interest rate increases by the Bank of Canada that boosted the appeal of Canada's triple A-rated government bonds and its corporate debt.

That has pushed the year-to-date foreign inflows to C$152 billion, on track to match or beat last year's record of C$172 billion. Net inflows easily exceed the amount needed to cover Canada's annual current account deficit of about C$60 billion.

Greg Anderson, global head of foreign exchange strategy at BMO Capital Markets in New York, said the sustained inflows indicate there is more to the Canadian dollar rally than speculators "getting excited and getting long" the currency.

    The loonie surged as much as 14 percent between May and September as speculators swung from being heavily bearish on the currency to raising bullish bets in October to the highest in five years.

Some of that hot money left the Canadian dollar, the world's sixth most actively traded currency, after the central bank dampened prospects for further rate increases this year,

Still, market players say that fundamentals point to further portfolio inflows, as a pick-up in global growth boosts commodity prices.

"For international investors, when you want to buy commodity producers, you end up buying Canada," Anderson said.

Canada's resource-heavy TSX <.GSPTSE> has rallied as much as 8 percent since August to reach a record high, underpinned by strong domestic economic growth.

"I think Canada is doing better than what the Bank of Canada is saying," said Krishen Rangasamy, senior economist at National Bank Financial. "I think foreigners are responding to the economy and that is why we are seeing such huge inflows into Canada."

($1 = 1.2755 Canadian dollars)

(Reporting by Fergal Smith; Editing by Steve Orlofsky)

By Fergal Smith