Rising oil prices helped lift Canada’s largest stock index higher Tuesday, while the Dow Jones average snapped an eight-day losing streak amid strong consumer confidence and renewed optimism about U.S. President Donald Trump’s pro-growth agenda.

The Toronto Stock Exchange’s S&P/TSX composite index gained 92.35 points to 15,598.57, as energy, metal and industrial stocks led gainers.

The May crude contract was up 64¢ at US$48.37 per barrel on the heels of reports of a production disruption at an oilfield in Libya and growing hopes that OPEC will extend its output cuts to the end of the year.

The Canadian dollar, which often follows the direction of oil prices, lost 0.04 of a U.S. cent at US74.72¢ despite the uptick in crude.

Although the price of a barrel may be getting some relief, investors shouldn’t consider this the start of a long-term run-up, said Todd Mattina, a strategist and chief economist with Mackenzie Investments.

“The longer-term outlook is still clouded by the shale revolution in the U.S.,” said Mattina.

“As long as U.S. shale producers can produce at a lower cost and bring new oil supply quickly to the market, when prices do start rising we’re going to see downward pressure on oil prices for the medium term. It’s important to put today’s move in context. It’s still a modest move.”

South of the border, the Dow Jones industrial average climbed 150.52 points to 20,701.50 and the S&P 500 index was ahead 16.98 points to 2,358.57. The tech-heavy Nasdaq composite index also finished higher, up 34.77 points to 5,875.14.

The gain in U.S. indices is being driven by a Conference Board report that its consumer confidence index rose this month to its highest level in more than 16 years. The survey found that most Americans expect hiring and incomes to rise over the next six months, while nearly a third described business conditions as “good” in March.

Economists closely monitor the mood of consumers because their spending accounts for about 70% of U.S. economic activity.

President Trump has cited consumer confidence as evidence that his administration is succeeding. When the index increased in December, he tweeted out the figures along with the self-congratulatory line, “Thanks Donald!”

Investors also seemed to strike a more optimistic tone over Trump’s agenda, despite his health-care bid failing to pass in Congress last week.

“With the Trump reflation trade, even bad news is good news,” said Mattina.

“After a couple of days of disappointment and a repricing of what the outlook might look like, there has been more noise about shifting gears towards the tax reform. … That’s where the markets’ focus has shifted.”

In commodities, May natural gas contracts were up US5¢ at US$3.18 per mmBTU, May copper contracts added US4¢ at US$2.68 a pound and the April gold contract lost US10¢ at US$1,255.60 an ounce.

With files from The Associated Press