* Wholesale trade beats forecasts on autos, machinery
* Foreigners invest heavily in Canadian stocks, bonds
* Leading indicator rises, signals end to soft patch
* September and Q3 GDP still seen weak
By Louise Egan
OTTAWA, Nov 18 (Reuters) - A rare set of upbeat Canadian economic data on Thursday raised hopes the recovery would veer back on track, despite an anemic third quarter that has kept central bank interest rates on hold.
Statistics Canada said wholesale trade in September climbed 0.4 percent, twice the rate forecast, on a surge in auto and machinery sales.
Foreign investors continued to be lured into Canadian markets in a big way that same month, scooping up C$12.25 billion ($12.01 billion) billion worth of securities with a focus on private corporate bonds issued by resource and financial firms, and provincial bonds.
In October, the composite leading indicator beat expectations with a 0.2 percent gain, pushed higher by the stock market and stronger demand for exports.
The leading indicator's performance was "a sign the soft patch in the Canadian economy is ending," according to Jonathan Basile, vice-president of economics at Credit Suisse.
While the wholesale figures are a plus for monthly gross domestic product, Scotia Capital economists Derek Holt and Gorica Djeric said the economy may still contract in September and growth could slow in the third quarter overall.
Bad news on exports, manufacturing sales and housing starts in the past few days has pointed to a further slowdown in growth from the already disappointing 2 percent annualized pace in the second quarter.
Statscan will provide quarterly GDP figures on Nov. 30.
"Despite today's gain, September GDP could come in negative," said Holt and Djeric in a note to clients.
"Our hope is for a decent gain in September's retail sales report ... and what are expected to be solid results from the broad cross sections of the services and resource sectors, which are largely unobservable, but likely performing healthier than manufacturing and housing related sectors."
The Bank of Canada, which projects 1.6 percent growth in the July-September period, is widely expected to keep its key interest rate unchanged at 1 percent in December and through the first quarter of next year.
The data contributed to the Canadian dollar's bounce
against its U.S. counterpart on Thursday. The currency
BOND BUYING EXTENDED
The biggest rise in wholesale activity came in the motor vehicle and parts sector, while the machinery, equipment and supplies sector also posted strong gains. Wholesale inventories grew for the fifth time in six months, up 0.5 percent.
Foreign investors continued a Canadian bond-buying spree that began in January, adding C$8.81 billion worth of bonds to their portfolios in September.
Of the total, C$3.6 billion was in private corporate bonds. Money pouring into federal government bonds has doubled since January 2009 but tapered off to C$1.9 billion from C$3.2 billion in August.
Nonresidents also bought C$3.28 billion in stocks, which Statscan said was the result of foreign takeovers of Canadian companies and the resulting new issues to shareholders.
Canadians, for their part, invested C$4.56 billion in foreign securities in September, mainly in stocks and to a lesser extent in bonds. (Additional reporting by Julia Johnson; editing by Rob Wilson)