TORONTO - The Toronto stock market closed higher Thursday as buyers picked up stocks across most sectors that had been beaten down over seven straight days of losses.

The S&P/TSX composite index rose 71.95 points to 13,255.74 after buyers preoccupied over a slowing American economy pushed the main index well into negative territory for the year over the last week. The TSX Venture Exchange gained 6.91 points to 1,958.57.

The Canadian dollar advanced against the greenback, up 0.69 of a cent to 102.76 cents US.

Statistics Canada reported that the country's trade deficit widened from $417 million in March to $924 million in April. The agency said merchandise exports decreased 1.9 per cent in April while imports fell 0.6 per cent.

Mining stocks led advancers with the base metals sector up 1.22 per cent amid flat metal prices as the July copper contract on the Nymex was unchanged at US$4.11 a pound. Teck Resources (TSX:TCK.B) climbed 87 cents to C$47.50 and HudBay Minerals (TSX:HBM) was up 25 cents to $14.05 and Taseko Mines (TSX:TKO) advanced 24 cents to $4.85 prior to the company releasing earnings after the close.

Gold stocks also advanced as bullion prices ran ahead with the August contract up $4 to US$1,542.70 an ounce. Kinross Gold Corp. (TSX:K) improved by 48 cents to C$$15.25 while Goldcorp Inc. (TSX:G) rose 40 cents to $46.42.

The tech sector was also ahead with Research In Motion Ltd. (TSX:RIM) up 72 cents to $36.65.

The TSX energy sector was up 0.31 per cent as oil prices closed just short of US$102 a barrel Thursday, extending gains from the previous session after OPEC leaders unexpectedly left crude production quotas unchanged.

The July crude contract on the New York Mercantile Exchange gained $1.19 to US$101.93 a barrel.

The gain followed a climb of US$1.65 Wednesday after OPEC oil ministers surprised investors by deciding not to boost production quotas at a meeting Wednesday in Vienna. Analysts had expected an increase of between one million and two million barrels per day in order to lower high oil prices which are being blamed for holding back the economic recovery.

Canadian Natural Resources (TSX:CNQ) gained 20 cents to $40.45 while Talisman Energy (TSX:TLM) advanced 21 cents to $19.76.

Markets have been depressed in the wake of a string of economic data that have pointed to a U.S. economy that is slowing faster than previously thought.

Pessimism deepened Wednesday after the U.S. Federal Reserve's latest cross-country survey of economic conditions, the so-called Beige Book, said Wednesday that the economy slowed in several U.S. regions this spring. High gasoline prices weakened consumer spending, and the Japan crises reduced manufacturing output.

A string of losses has left the TSX about 1,000 points below its highs for the year and about 200 points below where it started 2011.

"Let's put it this way: in December 2010 and January 2011, about 89 per cent of stocks for the TSX were above the 200-day moving average and the 200-day moving average is a good proxy," said Sid Mokhtari, market technician at CIBC World Markets.

"As it stands now, we have only 54 per cent of stocks that are above the 200-day. So we've had a very significant decay in the number of stocks that were previously holding their ground."

New York markets were higher after data showed that the U.S. trade deficit narrowed by 6.7 per cent in April to US$43.7 billion, the lowest level since December, as exports ran up to a record high.

The Dow Jones industrial average reversed a six-session series of declines, rising 75.42 points to 12,124.36.

The Nasdaq composite index was up 9.49 points to 2,684.87 while the S&P 500 index climbed 9.44 points to 1,289.

Traders also looked overseas where the European Central Bank announced it would keep its main interest rate unchanged at 1.25 per cent.

At the same time, ECB head Jean-Claude Trichet signalled a likely interest rate hike in July. Trichet said the bank was exercising "strong vigilance" against inflation, regarded as code for an increase at the next month's meeting even if it increases the burden on heavily indebted Greece, Portugal and Ireland.

In earnings news, tourism operator Transat A.T. Inc. (TSX:TRZ.B) reported that second-quarter profits grew to $8.6 million from $6.2 million a year ago. Revenue grew to $1.1 billion from $1.06 billion and its shares were up 25 cents at $11.11.

Grain handler Viterra Inc. (TSX:VT) said second-quarter profits rose to $33.1 million from $18.5 million a year earlier. Revenue increased to $2.7 billion from $2 billion. Its shares were ahead 13 cents to $11.08.

Dollarama Inc. (TSX:DOL) shares gained 88 cents to $31.88 as the retailer handed in first-quarter net earnings of $30.4 million, up from $22.5 million a year ago. Sales rose 11 per cent to $346.3 million. The company also declared an initial quarterly dividend of nine cents per share.

Shares in infrastructure products manufacturer Armtec Infrastructure Inc. (TSX:ARF) plunged $6.15 or 58.57 per cent to $4.35 as the company reported first-quarter net loss of $13.3 million or 65 cents per share, compared with a loss of $10.6 million or 52 cents in the same 2010 period. Revenue was just under $75 million, compared with $71.5 million in the year-earlier period and the firm suspended its quarterly dividend.