Stocks jumped on Tuesday as investors hoped U.S. lawmakers were close to an agreement on a stimulus bill to rescue the economy from the coronavirus.

The Dow Jones Industrial Average traded more than 1,000 points higher, or 5.9%. The S&P 500 gained 5.2% while the Nasdaq Composite advanced 5.1%.

Boeing gained more than 17% to lead the Dow higher. Chevron and United Technologies also rallied more than 11%. Energy was the best-performing sector in the S&P 500, soaring 9.3%, while industrials jumped 7.2%.

Senator Chuck Schumer and Treasury Secretary Steven Mnuchin said they hope to have a deal by Tuesday morning. “There are still a few little differences. Neither of us think they are in any way going to get in the way of a final agreement,” Schumer said.

“From a market perspective … it feels like we’re coming to the end of it,” said Michael Novogratz, CEO of Galaxy Digital, on CNBC’s “Squawk Box.” Novogratz started buying into this market on Monday, he said. “It doesn’t necessarily mean the market’s going to go up, but a lot of that crazy volatility is kind of coming out.”

Tuesday’s moves followed yet another stormy day on Monday as investors swung back to pessimism and pushed the major indexes to new multiyear lows as a procedural vote in the Senate on a bill failed for the second time in 24 hours.

The Dow dropped 582.05 points, or 3%, on Monday and remained on pace to clinch its worst calendar month since 1931. The S&P 500 dropped 2.9% to 2,237 and closed 34% below a record set last month as both indexes sank further into bear markets amid the COVID-19 outbreak.

Earlier in Monday’s session, a bill that would authorize giant fiscal spending to stimulate the economy failed to clear a key procedural hurdle. The Senate disagreement came despite Treasury Secretary Steven Mnuchin’s optimism to CNBC’s Jim Cramer that Congress was “very close” to getting a fiscal package done, noting it must be pushed forward “today.”

“We’re using some of the funds we have, but we need Congress to approve additional funds today so that we can move forward and support American workers and the American economy,” Mnuchin said.

Senate Minority Leader Chuck Schumer, D-NY, said Monday afternoon after the second failure that he and Mnuchin would meet again to try and work out a deal over the course of Monday night.

Democrats have criticized the $500 billion fund that the Republican proposal sets aside for distressed businesses, calling it a bailout fund “with no strings attached.”

Two Senate aides told CNBC that there will be no more Senate votes Monday as negotiations continue.

“I think the limit of time as to how long these negotiations will go on, will be set by the initial unemployment claims that come out on Thursday,” Steven Ricchiuto, chief U.S. economist at Mizuho Securities, told CNBC’s “Squawk Box Asia” on Tuesday morning Singapore time.

“I don’t think there’s any representative in the House or … in the Senate who’s gonna be willing to sit back and debate a lot of issues … and political talking points when you have what could be essentially as many as 3 million people filing for unemployment insurance,” Ricchuito said.

Helping to keep Monday’s losses in check was an announcement from the Federal Reserve, which said it would embark on an open-ended asset purchase program. The central bank said the program will run in the “amounts needed to support smooth market functioning and effective transmission of monetary policy to broader financial conditions and the economy.”

The spread of the coronavirus also forced the New York Stock Exchange to conduct its first day of fully electronic trading. The exchange said last week that two people tested positive for the disease at screenings it conducted this week.

—CNBC’s Eustance Huang contributed to this report.