The Toronto stock market closed higher Wednesday after bouncing between red and black all day as investors seemed puzzled over mixed signals about the U.S. and European economies.

The S&P/TSX composite index moved 36.65 points higher to 11,753.53. The TSX Venture Exchange lost 0.55 points to 1,439.75.

A surge in shares of market heavyweight Research In Motion Ltd. (TSX:RIM) buoyed the market following reports that the Blackberry maker had turned down potential takeover offers from online retail giant Amazon.com and other major technology players.

The Waterloo, Ont.,-based company’s stock was up 9.8% or $1.27 to close at $14.17.

The Canadian dollar added 0.42 of a cent to 97.48 cents US after Statistics Canada reported much stronger than expected October retail sales. Sales rose 1% across a broad range of goods from food to cars, while economists had been expecting a 0.7% increase.

Commodity prices were mixed with the February oil contract adding $1.43 to US$98.67 a barrel.

The energy sector was one of the biggest gainers, up 0.7%, while shares in oil producer Suncor Energy (TSX:SU) gained seven cents to C$28.08.

The February gold contract was down $4 to US$1,613.60 an ounce and the March copper contract up two cents at US$3.39 a pound.

On the TSX, the mining sector was down 0.2%. Shares in base metals miner Teck Resources (TSX:TCK.B) lost 16 cents to C$35.49, while shares in gold miner Goldcorp Inc. (TSX:G) slid 1.7% or 78 cents to C$46.10.

Wall Street also recovered just before the close with the Dow Jones index adding 4.16 points to 12,107.74. The broader S&P index moved 4.12 points higher to 1,243.72.

The Nasdaq index pared earlier losses but closed down 25.76 points to 2,577.97, weighed by technology stocks a day after business software company Oracle said it was struggling to close deals. The results seemed to reinforce worries that businesses and the government may cut technology spending.

On a sparse day for economic news, the U.S. National Association of Realtors reported home sales rose 4% last month to a seasonally adjusted annual rate of 4.42 million. The rise puts sales this year are on pace to be slightly ahead of last year’s total of about 4.25 million.

But the association also said it overstated more than three million in sales during and after the Great Recession, the major economic downturn between 2008 and 2009, showing the housing market remains much weaker than previously thought

There’s also uncertainty over whether Washington will extend a tax cut.

The White House said President Barack Obama has called House Speaker John Boehner to bring the House back into session to pass a two-month extension of the cuts previously approved by the Senate. Unless the House passes the two-month extension, taxes will increase on 160 million people after Jan. 1.

On Tuesday, encouraging signs out of Europe and a surprisingly strong report on housing starts in the United States drove the Dow up more than 300 points and the TSX up nearly 200 points. It was the best day for stocks this month.

Colin Cieszynski, a market analyst at CMC Markets Canada, noted that investors appeared to be engaging in some profit-taking from Tuesday’s rally. As the end of the year approaches, many investors are squaring up their balance sheets.

On Wednesday, initial optimism over the ECB’s massive €489-billion (US$639-billion) loan to 523 banks gave way to the reality that the credit infusion only treats one of the symptoms of the eurozone crisis.

It does not remove the reasons banks remain wary of lending to each other and especially their thin levels of capital reserves against potential losses. And it doesn’t cut the large levels of debt carried by governments.

“The street had initially reacted positively to news of strong pickup at the ECB’s long-term refinancing operation until sober second thought realized that banks lining up around the block for cheap loans can also be seen as a sign of weakness,” Cieszynski said.

Many economists think the eurozone may be headed for at least a mild recession in coming months.

In Canadian corporate news, shares in TMX Group Inc. (TSX:X) added 15 cents after it said it purchased a 16% minority stake in the Bermuda Stock Exchange. They closed at $42.

SNC-Lavalin (TSX:SNC) has been awarded a contract by MacKay Operating Corp. to provide detailed engineering and procurement services for Alberta’s MacKay River Central Plant oilsands project. Shares fell 69 cents to $47.25.

Stock in Corridor Resources Inc. (TSX:CDH) plunged more than a third after the company announced it has so far been unsuccessful in attracting a partner for its shale gas project in New Brunswick. Shares closed down 38% or 69 cents at $1.13.