* C$ ends at C$0.9780 vs US$, or $1.0225 * Moody's keeps Spain at investment grade, boosts sentiment * Currency helped by strong U.S. housing report * Bank of Canada's less hawkish tone limits C$ gains By Claire Sibonney TORONTO, Oct 17 (Reuters) - Canada's dollar firmed against the U.S. currency on Wednesday, following a broad rally in riskier assets after Spain avoided a debt-rating downgrade and on growing speculation its government will ask for a bailout next month. Credit ratings agency Moody's affirmed Spain's investment-grade rating late Tuesday, assuaging widespread fears that Spain could be cut to "junk" status. Moody's based its decision on the assumption that Madrid would ask for help in holding down its borrowing costs. "Overall market sentiment has improved," said Darren Richardson, a senior corporate dealer at CanadianForex. "Spain not being downgraded to junk has provided a little bit of confidence." Data that showed groundbreaking on new U.S. homes surged in September at its fastest pace in more than four years also helped the Canadian dollar. Most of the country's exports, from building materials to oil, go to its southern neighbor. The currency ended the North American session at C$0.9780 versus the U.S. dollar, or $1.0225, compared with C$0.9868, or $1.0134, at Tuesday's close. Richardson said Canadian dollar resistance was holding in around C$0.9775, or $1.0230. Market players noted that the Canadian dollar has not gained to the same extent as some other currencies. They pointed to a recent speech by Bank of Canada Governor Mark Carney, which investors have interpreted as being less hawkish on interest rates. [ID: "(There's) probably a lingering impact from Carney's speech the other day," said Benjamin Reitzes, senior economist and foreign exchange strategist at BMO Capital Markets. Canada's dollar was weak against other major currencies on Wednesday. It fell to an almost four-month low of C$1.2941 versus the euro, or 77.27 euro cents, and a more than three-month low against the Swiss franc. The Canadian currency dropped to C$1.0195 versus the Australian currency, or 98.09 Australian cents, its weakest level since Oct 1. The pair often move in tandem as both Canada and Australia are natural resource exporters. Looking ahead to Thursday, investors will be paying close attention to China's growth figures, due overnight. China's annual economic growth probably slowed for a seventh straight quarter in the July-September period to the weakest level since the depths of the global financial crisis, a Reuters poll showed, reinforcing the case for further policy stimulus. Canadian bond prices highlighted the move away from safe haven assets, tracking U.S. Treasuries lower. The two-year bond fell 9 Canadian cents to yield 1.125 percent, while the benchmark 10-year bond dropped 76 Canadian cents to yield 1.906 percent.