* C$ at C$0.9832 vs US$, or $1.0171 * C$ up 3.55 percent in third quarter * Bonds rise across the curve By Solarina Ho TORONTO, Sept 28 (Reuters) - Canada's dollar retreated against the U.S. dollar on Friday after a bevy of North American data and as attention turned from Spain's new budget to the next tests for the euro zone. The currency tracked global equity markets, which declined after initial optimism about Madrid's debt-cutting plans gave way to anxiety over its troubled banks and faltering global economic growth. Spain plans to ask for around 40 billion euros ($51.46 billion) in European aid to recapitalize its weak banks, Bank of Spain deputy Governor Fernando Restoy said on Friday. An independent report said Spanish banks will need 59.3 billion euros ($76.3 billion) in extra capital to ride out a serious economic downturn. Investors rebalancing their portfolios and unwinding their positions also contributed to the weaker performance. "The Canadian dollar has struggled this afternoon ... It's the end of the quarter and the end of the month and there seems to be a tremendous demand for U.S. dollar across the board," said Adam Button, currency analyst at ForexLive in Montreal. "If we look back throughout this quarter, the Canadian dollar is right at the top of the leaderboard with the New Zealand dollar as the best performer. Oftentimes, you'll see speculative money unwind those trades at the end of the quarter to get into cash." The currency finished the week at C$0.9832 versus the U.S. dollar, or $1.0171, weaker than Thursday's North American finish at C$0.9809, or $1.0195. Canada's dollar has climbed 3.55 percent during the third quarter, bolstered by central bank stimulus measures in the United States and abroad, and the Bank of Canada's own hawkish stance. "Canada is in an enviable economic position where we have solid growth even when it's not spectacular ... In an environment where there's so much uncertainty, that's one of the best qualities you'll find in a currency," said Button, who expects the currency to strengthen further in October. NORTH AMERICAN DATA Canadian government data showed that the country's economy grew by an inflation-adjusted 0.2 percent in July on strength in manufacturing, utilities and wholesale and retail trade. The results exceeded analysts' expectations but June growth figures were revised down, leaving actual gross domestic product in July almost exactly as forecast. "The economy is continuing to expand, but the pace at around 2 percent is very modest and not going to provide much downward pressure on the unemployment rate," said Paul Ferley, assistant chief economist at Royal Bank of Canada. "With the revision, the overall pace is still fairly moderate (and) argues for the Bank of Canada to continue to keep monetary conditions highly stimulative." South of the border, U.S. consumer spending rose in August by the most in six months as households stretched to pay for higher gasoline prices, according to a government report on Friday. Other data showed factory activity in the Midwest contracted this month for the first time in three years. The two-year Canadian government bond rose 6.5 Canadian cents to yield 1.069 percent, while the benchmark 10-year bond was up 25 Canadian cents, yielding 1.728 percent.