* C$ at C$0.9842 to US$, or $1.0160 * Moody's keeps Spain at investment grade, boosts sentiment * Bank of Canada's less hawkish tone caps C$ gains By Alastair Sharp TORONTO, Oct 17 (Reuters) - The Canadian dollar strengthened against the U.S. currency on Wednesday as Spain's avoidance of a rating downgrade boosted sentiment, though gains were limited by a recent Bank of Canada speech which investors interpreted as less hawkish on rates. Credit rating agency Moody's affirmed Spain's investment grade rating late on Tuesday, assuaging widespread fears that Spain could be cut to 'junk' status, although it based its decision on the assumption that Madrid would ask for help in holding down its borrowing costs. "Stronger risk appetite on the back of Moody's decision not to downgrade Spain is pretty much lifting all risk assets, the Canadian dollar is one of those," said Benjamin Reitzes, senior economist and foreign exchange strategist at BMO Capital Markets. "That's why you're getting some strength, not to the same extent as some other currencies, that's probably a lingering impact from Carney's speech the other day." At 8:04 a.m. (1204 GMT) the Canadian dollar was trading at C$0.9842 to the greenback, or $1.0160, compared with C$0.9868, or $1.0134, at Tuesday's North American close. The Canadian currency hit an almost two-week low on Tuesday as investors digested a speech from the governor of the Bank of Canada in which he did not reference an intention to hike rates once conditions allow. Meanwhile, the Australian dollar hit a two-week high against the greenback and the euro was at its highest in a month.