New York CNN Business  — 

Wall Street on Tuesday cheered a reversal of two trends that had been weighing on investors: US politics and oil.

The Dow jumped 372 points Tuesday after politicians in the United States tentatively agreed on a plan to avert another government shutdown. Stocks also got a boost after Saudi Arabia revealed that it had cut oil production. The Nasdaq was up 1.5% and the broader S&P 500 was up 1.3%. Tuesday was the the best day of the month for the stock market — and the third-best of 2019.

Congressional negotiators said late Monday they reached an agreement in principle to avert a partial government shutdown at the end of this week. The deal will not be final until Congress passes it and President Donald Trump signs it — leaving a lot of room for a new development to scuttle the agreement. But Wall Street was optimistic that American lawmakers would avoid another crisis.

“The markets abhor uncertainty so this is spectacular news removing one of the major impediments to US economic growth and prosperity and better financial market conditions,” said Chris Rupkey, chief financial economist at MUFG.

The last 5-week shutdown, which ended last month, cost the US economy $11 billion — $3 billion of which the economy will never recover, according to the Congressional Budget Office. That’s not a huge dent to America’s near-$20 trillion economy. But that level of political intransigence made Wall Street worried about the ability of politicians to agree on something potentially much more serious: raising the US debt ceiling.

In the next few months, lawmakers will have to vote to pay down the debt America owes. If it doesn’t, the United States could default on its debt payments. That could signal America won’t pay back its creditors, potentially sending a shock through the US Treasury market, which the government relies on to fund its programs and make up for its massive budget shortfall.

Credit-rating agencies have already warned that they will cut the United States’ credit rating if lawmakers don’t increase the debt ceiling, which would raise the amount of money the government needs to pay on its debt payments. Credit-rating agencies cut America’s perfect AAA rating to AA+ in 2011 when the government came close to missing a debt payment.

The shutdown deal gives investors hope that politicians won’t shoot themselves in the foot once again when the stakes are potentially much higher.

Oil moves higher

OPEC, the oil cartel led by Saudi Arabia, announced Tuesday that it had cut production by 800,000 barrels per day. That eased investors’ concerns that a global economic slowdown would continue to hurt demand, and that oil producers aren’t doing enough to slow production.

The price of US crude rose 1.3% Tuesday to $53.09 a barrel.

Oil has been rising in recent weeks after the United States sanctioned Venezuela, a large supplier of crude around the world. The sanctions on Iran have also supported oil prices.

But increased crude production in the United States has weighed on oil over the past year. Still, the price of oil could increase between 10% and 15% this year because of OPEC’s production cuts and sanctions, Francisco Blanch, head of global commodities research at Bank of America Merrill Lynch told Julia Chatterly on CNNi’s “First Move” Tuesday.

Energy stocks rallied. Hess (HES) rose 3% and Devon Energy (DVN) was up 2%.