U.S. stocks closed sharply higher Wednesday, in the latest example of heavy intraday volatility as investors continued to suss out the likelihood of, or the potential impact from, a trade war between the United States and China.

Major indexes opened sharply lower, with the S&P 500 initially dropping back below a key technical level, but stocks strengthened throughout the session, ultimately ending up more than 1% in a complete turnaround, with the widespread losses that marked the open turning to broad gains at the close.

The move underlines how investors are having difficulty gauging the impact of trade-related threats and counter-threats between the U.S. and major trading partners. The issue has contributed to volatility in both directions as investors attempt to calculate what effect, if any, it will have on corporate earnings and economic growth.

What did the main benchmarks do?

The Dow Jones Industrial Average DJIA, +0.51% rose 231 points, or 1%, to 24,264. The blue-chip gauge had been down by as many as 510 points at its session low. The S&P 500 index SPX, +1.05% gained 30 points to 2,645, or 1.2%. The Nasdaq Composite Index COMP, +1.71% gained 101 points, or 1.5%, to 7,042.

All three closed higher for a second straight session, and it was the first time the S&P had risen in back-to-back sessions since a two-day stretch ending March 9.

All three indexes had dropped more than 1% at their lows of the session, and the Nasdaq at one point traded below 6,829.49, the level that marks correction territory, or a 10% drop from a closing peak. With the positive close, however, the Nasdaq ended in positive territory for the year and the S&P 500 finished safely above its 200-day moving average for a second straight session, a positive sign for long-term momentum trends.

Equities have been extremely volatile of late. Major indexes all rose by more than 1% on Tuesday, rebounding partially from Monday’s sharp selloff. So far this year, the S&P 500 has had three times as many sessions with a 1% move than in all of 2017.

What’s driving markets?

Worries are persisting about a potential global trade war, exacerbated by China’s response to the U.S. government’s recent tariff announcement. Signaling a tit-for-tat approach, China’s Ministry of Commerce said they plan to impose tariffs of up to 25% on 106 American products, including soybeans and airplanes, affecting $50 billion of U.S. goods.

The retaliation was the latest sign that trade conflicts between the U.S. and major trading partners are escalating, something analysts have cited as a primary risk for equities this year.

See:5 charts that show how China’s response to U.S. tariffs is rattling markets

And read:U.S. soybeans would be China’s biggest weapon in a trade war

Check out:How a ‘trade skirmish’ could become a global ‘trade war’

What are strategists saying?

“The prospects for a trade war are there, investors are just not sure how to assess the impact that could come. This brings in an incredible amount of uncertainty, but people may just respond to things as they unfold,” said Michael O’Rourke, chief market strategist at JonesTrading.

“Because recent lows in the market have held, people may feel a bit more comfortable buying the dip, even though nothing has changed or been resolved,” he said.

Which stocks are in focus?

Despite the broader rebound, some industrial stocks — a sector with outsize exposure to trade issues — still fell on the day. Boeing Co.’s stock BA, +0.28% fell 1%, while heavy-machinery maker Deere & Co. DE, +1.57% fell 2.9%.

Technology stocks also remained in focus, after recent volatility. Facebook Inc. FB, +2.66% fell 0.7% after lawmakers said Chief Executive Officer Mark Zuckerberg would testify before the House Energy and Commerce Committee on April 11 about the company’s use and protection of user data. This issue has spurred heavy selling in the social-media giant, taking it into bear-market territory, or a drop of 20% from a peak.

Shares of e-commerce giant Amazon.com Inc. AMZN, +5.69% rose 1.3%. The company, which often moves on tech issues but is classified as a consumer-discretionary stock, has been under pressure from President Donald Trump’s attacks on it, though analysts said it was unlikely Trump’s attacks would result in a meaningfully different regulatory environment.

Tesla Inc. shares TSLA, -5.59% gained 7.3% in its biggest one-day gain in about a year. Late Tuesday, the maker of electric cars reported first-quarter production and delivery numbers that missed expectations, but said it would not need to raise more money this year. Analysts noted the company also said this in early 2016, shortly before it did raise several billion dollars.

Music-streaming service Spotify Technology SA SPOT, +0.69% SPOT, +0.69% stayed in the spotlight in its second day of trading on the New York Stock Exchange. The stock opened with a bang Tuesday, but closed on a down note. Shares fell 3.2% on Wednesday.

CBS Corp. US:CBS rose 1.8% after the media giant reportedly made an offer to acquire Paramount Pictures parent Viacom Inc. US:VIAB that was below Viacom’s current market value of $12.5 billion. Both CBS and Viacom are controlled by media mogul Sumner Redstone’s holding company. Viacom shares rose 3.9%.

Shares in home builder Lennar Corp. LEN, +4.03% rose 10% following better-than-expected earnings. It was the best day for the stock since May 2010.

Used-car seller CarMax Inc. KMX, +3.14% rose 4.6% after its results.

Proteostasis Therapeutics Inc. PTI, -5.73% climbed 6.5% after the Food and Drug Administration gave a “fast track” designation to its cystic fibrosis treatment.

Which economic reports are in focus?

ADP’s report on private-sector employment showed 241,000 jobs added in March, far more than had been expected. The news is a positive read on the labor market ahead of Friday’s closely watched government data on nonfarm payrolls.

Markit’s March report on services came in at 54, a drop from the previous reading of 55.9, while the Institute for Supply Management was at 58.8, with economists polled by MarketWatch forecasting a March reading of 59.0%.

Meanwhile, February factory orders data rose 1.2%, with 1.7% growth expected.

Check out:MarketWatch’s Economic Calendar

James Bullard, the president of the St. Louis Fed, said there was no reason to raise interest rates further.

What are other markets doing?

European stocks SXXP, +0.20% fell slightly, after Asian markets finished lower.

Gold futures US:GCM8 climbed, while oil futures US:CLK8 and the ICE U.S. Dollar Index DXY, +0.18% lost ground.