The two best known stock indexes in Canada and the U.S. closed at record highs on Tuesday, as the price of oil pushes higher and U.S. companies posted strong profits.

The S&P/TSX Composite Index of the largest companies on the Toronto Stock Exchange closed up 93 points to 16,671.

That beats the previous all-time high the index hit last week, when it headed into the long weekend at 16,612.

The biggest thing driving Canadian stocks higher was the price of oil, as a barrel of West Texas Intermediate gained 77 cents to close at $66.32 US. Oil prices have risen for three trading days in a row now, buoyed by Monday’s news that the U.S. will extend sanction on Iranian oil to five more countries.

While the higher oil price was good for the TSX’s resource sector, “investors generally are responding favourably to earnings reports and that’s an overall positive thing,” said Colin Ciezinski, chief market strategist with SIA Wealth Management, in an interview.

He doesn’t see any major events on the horizon that could disrupt things, which is why strong corporate earnings will be key to setting the market’s direction. He sees the TSX trending higher into the summer, but Tuesday’s “breakout to a new high is significant and showing a lot of interest,” he said.

Stock markets gained even more south of the border, where the S&P 500 — an index of the 500 biggest public corporations in the U.S. — closed up 25 points to 29,33. That’s up from the previous closing high of 2,925 it hit last October.

Big companies including Hasbro, Lockheed Martin and Twitter all surprised Wall Street with strong profit and revenue.

Twitter shares jump 16%

Twitter revealed that its advertising revenues doubled, and the social media company says its number of daily users increased by 11 per cent during the quarter. The stock gained 16 per cent, buoying the entire tech space.

“We’re getting a nice forward-looking picture from those companies,” said J.J. Kinahan, chief market strategist for TD Ameritrade.

Other big names such as Caterpillar, Boeing and Microsoft are all scheduled to post earnings on Wednesday, numbers which will be closely watched to see if the optimism can continue.