Stocks rose Friday, snapping a four-day losing streak and bucking recent concerns about the trade war even after the Trump administration imposed fresh tariffs on imports from China and trade negotiations between Washington and Beijing ended with no announced deal.

After dropping more than 1.5 percent early in the day, the S&P 500 clawed back those losses and had gained 0.4 percent by the close of trading.

It was an inconclusive end to the market’s worst week of the year, a choppy series of trading sessions in which investors were riveted by presidential tweets that amounted to a running public commentary on the talks. For the week, the S&P 500 dropped 2.2 percent.

“Because people don’t have conviction, the slightest bit of news is moving the market,” said JJ Kinahan, chief market strategist at TD Ameritrade. “This is the biggest story that’s hanging over it.”