The Toronto stock market closed higher Tuesday amid rising prices for oil and metals and disappointing earnings from pipeline giant TransCanada (TSX:TRP).

The S&P/TSX composite index was ahead 40.87 points to 12,789.02 while the TSX Venture Exchange climbed 2.74 points to 1,198.94.

The Canadian dollar was up 0.16 of a cent to 99.73 cents US as traders took in a statement by the Group of Seven leading industrialized countries, including Canada, which affirmed their commitment to exchange rates determined by markets and not government policy.

The statement came out prior to a weekend meeting of the Group of 20 finance ministers where exchange rates and the threat of a “currency war” are expected to feature heavily.

Attention has centred recently on the Japanese yen, which dropped Monday to its lowest level against the U.S. dollar since May 2010. The Japanese government has set in motion a string of economic policies, such as a higher two per cent target for Japanese inflation, that many in the markets think will lead to more money being created in Japan.

One parallel effect of that policy has been a rise in the euro, which threatens to hinder Europe’s economic recovery.

Despite the G7 statement, the yen remained stable as analysts observed that any country could claim that its loose monetary policy was aimed at helping the domestic economy, not setting the interest rate.

U.S. indexes were mainly positive as traders looked ahead to President Barack Obama’s state of the union address Tuesday evening. The Dow Jones industrials was up 47.46 points to 14,018.7, closing at its highest level of the year and coming within one per cent of its record reached in October 2007.

The latest gain was powered by impressive results from two big consumer brands, Avon and luxury clothing maker Michael Kors.

The Nasdaq lost 5.51 points to 3,186.49, dragged down by a 2.5% decline in Apple stock after CEO Tim Cook said that the company is “seriously” looking at ways to hand out more cash to shareholders.

At the same time, he called a shareholder lawsuit against the company a “silly sideshow.” Investor David Einhorn sued Apple last week, saying a proposal slated for a vote at the company’s annual meeting in two weeks would make it more difficult to enact his plan to reward shareholders by distributing a new class of shares.

The S&P 500 index was ahead 2.42 points to 1,519.43.

TransCanada Corp. (TSX:TRP), which is currently seeking U.S. approval for the Keystone XL pipeline which would carry oilsands crude from Alberta to Texas, reported that its net income fell to $306 million or 43 cents per share. Its comparable earnings, which exclude most unusual items, declined to $318 million or 45 cents per share.

Analysts had been expecting 51 cents per share of net earnings and 49 cents per share of adjusted earnings.

TransCanada also said its quarterly dividend will rise by two cents per share to 46 cents for the quarter and its shares slipped 69 cents to $47.56.

It also said that it expects the Keystone XL pipeline to be in service in late 2014 or early 2015.

“That is all going to depend on politics — maybe we will get some clues tonight, maybe Obama will say something (during his state of the union speech),” said Ian Nakamoto, director of research at MacDougall, MacDougall and MacTier.

“More than likely it will get approved. There will be some political wrangling but it will get approved.”

The energy sector was the leading advancer, up one per cent as the March contract on the New York Mercantile Exchange gained 48 cents to US$97.51 a barrel. Canadian Natural Resources (TSX:CNQ) climbed $1.04 to C$31.55.

A U.S. agency has given the final approval required for the acquisition of Calgary-based Nexen Inc. (TSX:NXY) by CNOOC, one of China’s largest energy companies. The US$15.1-billion friendly takeover had broad implications in Canada and elsewhere, due to Nexen’s extensive holdings in Alberta’s oilsands, Gulf of Mexico and North Sea. Nexen shares gained 55 cents to C$27.48.

Industrials provided lift to the TSX as WestJet (TSX:WJA) climbed 49 cents to $21.73 a day after the carrier announced it is boosting its base in Western Canada by launching its Encore regional service in June to British Columbia’s energy region using the airline’s first Bombardier turboprops.

Bombardier shares were unchanged at $4.09 as the General Aviation Manufacturers Association said the transport giant retained its position as the world’s largest business jet manufacturer in 2012. The Montreal-based company kept the title despite an 11% drop in the value of its global deliveries in the fourth quarter.

The base metals sector was ahead 0.5% while March copper in New York moved up two cents to US$3.74 a pound. Teck Resources (TSX:TCK.B) advanced 68 cents to C$33.97.

The gold sector climbed about 0.5% as April gold bullion on the Nymex shed early losses and inched up 50 cents at US$1,649.60 an ounce. Endeavour Mining (TSX:EDV) rose six cents to C$2.04 and Yamana Gold (TSX:YRI) advanced 19 cents to $15.96.

Novagold Resources Inc. (TSX:NG) said Tuesday that the spinoff of its copper assets last year and other factors resulted in a $67.6-million net profit for the 2012 financial year, or about nine cents per share and its shares edged up eight cents to $4.45.

The tech sector was off 0.3% with CGI Group (TSX:GIB.A) up 51 cents to $28.33 while BlackBerry (TSX:BB) gave back 51 cents to $15.25.