TORONTO - Commodities stocks helped the Toronto stock market end the day in positive territory, despite a downturn on Wall Street spurred by sour economic news.

Toronto's S&P/TSX composite index closed ahead 62.38 points to 8,311.91 -- off of earlier triple-digit gains -- and the Canadian dollar increased 0.30 of a cent to 82.33 cents US.

The TSX energy sector gained 1.3 per cent as the light, sweet crude fell 93 cents to US$38.98 a barrel on the New York Mercantile Exchange.

The gold sector moved up 3.4 per cent as the February bullion contract dropped $9.10 to close at US$838.10.

Wall Street investors weren't so enthusiastic after processing the latest data on the housing market and overall economy.

The Dow Jones industrial average lost 100.20 points to 8,419.49. The Nasdaq composite index moved down 10.81 points to 1,521.54 and the S&P 500 lost 8.47 to 863.16.

The Commerce Department reported third-quarter gross domestic product, a measure of the economy that tallies the value of goods and services, fell at an annual rate of 0.5 per cent. That was in line with analysts' expectations and matched the government's estimate of a month ago.

The government also reported that sales of new homes fell in November to the slowest pace in nearly 18 years, while new home prices dropped by the biggest amount in eight months.

New home sales fell by 2.9 per cent to a seasonally adjusted annual sales pace of 407,000 units, a weaker performance than economists had expected and was the slowest sales pace since January 1991.

In Canada, Finance Minister Jim Flaherty said Tuesday that the federal government will run a deficit but not a "structural" deficit.

He also said that the budget he will present on Jan. 27 reveals "how we'll come out of deficit, so that it'll be clear to Canadians that as the economy recovers the deficit will disappear and we'll be in surplus again."

In the gold sector, Barrick Gold Corp. (TSX:ABX) has appointed Aaron Regent as president and chief executive after he formerly worked as co-chief executive officer of Brookfield Infrastructure Partners LP. Company shares were up $1.65 to $41.30.

Franco-Nevada Corp. (TSX:FNV) has entered into agreements with private investors to acquire a 7.29 per cent royalty interest on the Gold Quarry property in Nevada for US$103.5 million in cash. Shares rose 41 cents to $20.06.

Madacy Entertainment Income Fund (TSX:MEG.UN) units more than doubled in price, up 18.5 cents to 33.5 cents, after Clarke Inc. (TSX:CKI) struck a deal to take the music production company private. The deal values Madacy at $2.9 million.

Online gaming software firm CryptoLogic Ltd. (TSX:CRY) says its directors have rejected a request for nominees to its board from former CEO Javaid Aziz, a significant minority shareholder in the company. Shares in the company were ahead nearly five per cent, or 17 cents to $2.97.

The TSX Venture Exchange rose 6.29 points to 698.31.

In the U.S., greeting-card company American Greetings Corp. said it swung to a third-quarter loss, hurt by hefty charges and a decline in sales.

The trading session on Tuesday was the final full-length session of the week for Canadian markets. North American markets close at 1 p.m. ET on Christmas Eve and remain closed on Christmas Day.

Canadian markets will be closed on Dec. 26 for the Boxing Day holiday while U.S. markets trade in a regular session.