TORONTO, Aug 5 (Reuters) - Higher crude oil prices helped boost Canadian energy stocks on Wednesday, while figures that showed a surprise shrinking of the country's trade deficit in June aided broad investor sentiment, pushing up the main stock index.
Oil edged up for a second day after dipping below $50 a barrel. It has fallen 21 percent so far this quarter.
"We're trying to figure out which companies can operate and continue to do well in a situation as terrible as this," said Bryden Teich, associate portfolio manager at Avenue Investment Management.
Among the biggest gainers were pipeline operator Enbridge Inc, up 1.4 percent at C$58.38. Oil producer Canadian Natural Resources Ltd gained 2.1 percent to C$32.91 and Suncor Energy Inc added 1.3 percent to C$37.41. The overall energy group climbed 1.8 percent.
The Toronto Stock Exchange's S&P/TSX composite index looked on track for its fifth straight rise, up 116.41 points, or 0.79 percent, at 14,694.90 at midmorning.
Valeant Pharmaceuticals International, an acquisitive drugmaker that has risen quickly to become a major force on the index, rose 1.2 percent to C$346.65.
Fertilizer producer Potash Corp gained 1.1 percent to C$36.39. Its U.S. peer Mosaic Co reported a much higher-than-expected profit on Tuesday, helped in part by higher potash prices.
Canada's long-suffering export sector snapped a five-month losing streak in June, cutting the country's trade deficit significantly and contributing to a more buoyant tone in the equity market.
"A positive export number means potentially positive GDP data, so that means that maybe the consumer is a little bit better off," Teich said.
All of the index's 10 main groups were in positive territory, with advancing issues outnumbering decliners by a more than 3-to-1 ratio.
Reporting by Alastair Sharp; Editing by Peter Galloway