By Joe Wallace and Paul Vigna

U.S. stock wavered Tuesday, continuing a bout of volatility that has tested investors' confidence in the market's monthslong rebound.

The S&P 500 and Nasdaq Composite edged up 0.1%, while the Dow Jones Industrial Average was down 0.3%. The moves come one day after equities retreated sharply, pushing the S&P 500 to a fourth straight day of losses, the longest losing streak for the broad gauge since late February. After a blistering summer rally, stocks have cooled this month.

"We went too far, too fast," said Lindsey Bell, the chief investment strategist at Ally Invest. "I don't think any of this should be a surprise."

The turbulence entered a new phase Monday, when shares in sectors that are highly sensitive to economic growth, such as banks, materials and industrials, endured the biggest declines. Technology stocks, whose swings had weighed on markets in recent weeks, advanced.

Investors are contending with a clutch of risks that are intertwined. New cases of coronavirus are increasing in Europe, and reported new cases increased sharply in the U.S. on Monday, to 52,000. That was the highest single-day increase since Aug. 14, according to Johns Hopkins University.

A second wave of infections would hamper the economic recovery, which may be damaged further if Congress does not pass another relief package to provide additional unemployment benefits.

"It's key to the U.S. economy that the unemployment benefits continue to be delivered to the consumers, the households," said Sophie Chardon, cross-asset strategist at Lombard Odier. "Consumer confidence is still very fragile."

But the odds of a new relief package went down after Supreme Court Justice Ruth Bader Ginsburg passed away on Friday. The political fight over the court could also have an impact on the presidential election, and money managers must also think about the possibility of a protracted period of uncertainty following the election.

"The volatility will continue for a little while longer," said Andrew Sheets, chief cross-asset strategist at Morgan Stanley. Ultimately, the turbulence is likely to be a blip in a long-running bull market, he said. But for now, "investors should keep their powder dry" and not seek to buy stocks at discounted prices, Mr. Sheets added.

In Washington, Federal Reserve Chairman Jerome Powell and Treasury Secretary Steven Mnuchin testified on Capitol Hill about the government's pandemic response.

In prepared remarks published Monday, Mr. Powell suggested Congress would need to spend more to shore up struggling parts of the economy. "The path forward will depend on keeping the virus under control, and on policy actions taken at all levels of government," he said.

For now, stock traders are paying close attention to technical levels, Ms. Bell said. On Monday, the market's downswing halted as the S&P 500 came close to correction territory, or a 10% loss from a recent high. She expects traders will keep a close eye on that and other technical indicators, like the 100- and 200-day moving averages.

"This has been a technically driven market through the entire rebound," she said. "I expect that to continue."

Consumer stocks, both discretionary and staples, were leading the rebound on Tuesday. Shares of major technology companies, including Amazon.com, Facebook and Apple, were rising, though the tech sector itself was roughly flat.

The yields on the 10-year Treasury note ticked down to 0.663%, from 0.670% Monday. The WSJ Dollar Index, which tracks the U.S. currency against a basket of others, edged up 0.4%, a day after it notched its biggest one-day advance in over a month.

International stock markets were mixed. The Stoxx Europe 600 gained 0.5%, clawing back some ground after suffering its biggest fall since mid-June.

Asian markets followed U.S. shares lower. The Shanghai Composite Index fell 1.3% by the close, while South Korea's Kospi shed 2.4%.

Commodity markets steadied, with U.S. crude futures up 0.4% to $39.65 a barrel and gold futures down 0.1% to $1,909.50 a troy ounce.

Write to Joe Wallace at Joe.Wallace@wsj.com and Paul Vigna at paul.vigna@wsj.com