Markets posted modest gains Thursday as positive earnings from tech giant Research in Motion and a second day of testimony from U.S Federal Reserve Chairman Ben Bernanke quelled investor anxiety.

The S&P/TSX composite index closed up 37.15 points, or 0.28%, at 13,551.29.

Five of the 10 major TSX groups gained today.

The information tech group gained 1.19%, pushed up throughout the day by RIM shares, which traded heavily and closed up $5.79, or 4.92%, at $123.42. RIM announced late yesterday that fourth quarter net profits hit US$412.5 million or 72¢ per diluted share, up from US187.4 million, or 33¢ per share, a year ago.

The financials group closed relatively flat, up just 0.25%.

On the day of its annual meeting, TD Bank Financial Group shares closed up 21¢, or 0.33%, at $64. TD CEO Ed Clark told investors that the bank’s recently closed acquisition of U.S.-based Commerce Bancorp remains a positive step forward despite ongoing struggles in U.S. markets.

Bank of Montreal shares, however, gained 86¢, or 1.84%, to end at $47.50.

The materials group closed up 0.64%, and the base metals sector gained 2.77%.

Meanwhile, the gold sub-index sank 1.77%, despite the June gold contract rising US$9.40 to end at US$909.60 an ounce on the New York Mercantile Exchange.

New Gold Inc. announced that Canadian businessman Seymour Schulich has bought a 14% stake in the firm. The company’s stock rose 25¢, or 3.52%, to end at $7.35 on the news.

Meanwhile Kinross Gold Corp. shares fell 58¢, or 2.49%, to settle at $22.72.

The heavyweight energy group lost 0.69% as crude oil for May delivery fell US$1, or 1%, to end at US$103.83 a barrel on the Nymex. The contract rose to US$106.44 earlier in the day.

In other corporate news, Bombardier Inc. shares gained 35¢, or 6.25%, to end at $5.95, after it announced better-than-expected profits of US$317 million, up from $268 million in the previous year.

The junior S&P/TSX Venture composite index closed up 4.18 points, or 0.17%, at 2,509.03.

The Canadian dollar closed out at US99.56¢, up 0.90 of a cent from Wednesday’s close.

In his second day of testimony to Congress, Fed chief Ben Bernanke said the central bank hopes to reclaim most, if not all, of the money it loaned to prop up the battered Bear Stearns. His optimism cheered investors and U.S. markets closed higher.

The Dow Jones industrial average gained 20.20 points, or 0.16%, to end at 12,626.03. The S&P 500 moved ahead 1.78 points, or 0.13%, to close at 1,369.31.

Meanwhile, the tech-heavy Nasdaq composite index added 1.90 points, or 0.08%, to 2,363.30.