Stocks ended another roller-coaster day mostly higher on Wall Street, making up just a fraction of the ground they lost in a huge plunge the day before and more in Thursday’s Stock Market Update.

The major U.S. stock indexes spent most of the day wavering between gains and losses. They turned mostly higher by late afternoon after a sharp slide in U.S. government bond yields eased.

The market was coming off a steep loss from a day earlier, when the Dow Jones Industrial Average had its worst day of the year as stocks tumbled after a fairly reliable warning signal of recession emerged from the bond market.

Stocks in Asia and Europe paved the way for the turbulent day on Wall Street early Thursday after China said it would take “necessary countermeasures” if President Donald Trump follows through on a threat to impose tariffs on more than $100 billion of Chinese goods on Sept. 1.

The U.S. bond market, which has been among the loudest and earliest to cry out warnings about the economy, also continued to show concern as yields fell.

“What you’re seeing really is what’s been driving the market the last couple of weeks: Trade tensions as well as yield curve stress,” said Lindsey Bell, investment strategist at CFRA.

STOCK MARKET UPDATE

The S&P 500 rose 6 points, or 0.2%, to 2,847. The Dow Jones Industrial Average rose 99 points, or 0.4%, to 25,579. The Nasdaq slipped 7 points, or 0.1% to 7,766.

Markets around the world have jerked up and down for weeks. Prices for everything from stocks to gold to oil have been heaving as investors flail from one moment of uncertainty around Trump’s trade war to another around what central banks will do with interest rates.

In the U.S., Walmart shares climbed 6.1%, briefly helping to steady the market after it said it made a bigger profit in the last three months than Wall Street expected, thanks in part to strong online sales of groceries. A separate government report also showed that retail sales across the country last month rose more than economists expected.

Consumer spending makes up the bulk of the U.S. economy, and shoppers have been carrying the economy recently amid worries that businesses will pull back on their spending due to all the uncertainty created by the trade war. Other economies are slowing as the trade war is doing damage to manufacturers around the world.

Those concerns helped drive the yield on the 10-year Treasury down as low as 1.48% Thursday from 1.58% late Wednesday. The yield rose to 1.50% by late afternoon, which appeared to put some investors in a buying mood. That yield has been steadily dropping since late last year, when it was above 3%.

The 10-year yield has sunk so much that it dropped below the yield of the two-year Treasury Wednesday, a rare occurrence and one that has historically suggested a recession may be a year or two away.

The 30-year Treasury yield fell to 1.95% from 2.02% and earlier touched a record low, a sign of concern among investors. It also recovered some of its decline and stood at 1.98% Thursday afternoon. When worried about weaker economic growth and inflation, they tend to pile into Treasurys, which pushes up their prices and in turn pushes down yields.

“The countdown to a recession has just started,” said Hussein Sayed, Chief Market Strategist at FXTM.

Trump again defended his trade war Thursday and said a resolution with China has “got to be a deal, frankly, on our terms.”

After being hopeful earlier this year that a trade agreement may be imminent between the world’s two largest economies, investors are increasingly digging in for the tensions to drag on for years.

The trade war isn’t the only worry for investors. The United Kingdom’s pending exit from the European Union, political unrest in Hong Kong and a totally separate trade war between South Korea and Japan are all adding to the gloom.

The worries have pulled the S&P 500 down 4.5% so far this month, while other markets are down even more sharply. The S&P 500, though, remains within 6% of its record set late last month.

“The fact is that no one actually knows what is next for the markets,” said Fiona Cincotta, senior market analyst at City Index. “However, the signs flashing from the markets are not great.”

Cisco Systems plunged 8.6% for one of the sharpest losses in the S&P 500 after the technology giant gave a profit forecast that fell short of some analysts’ expectations. Technology stocks in the S&P 500 were weak in general, but gains for stocks of companies that sell consumer products, and tend to hold up in times of economic weakness, helped offset them.

General Electric sank 11.3% on news that the industrial conglomerate is being accused of hiding its financial problems by Harry Markopolos, the prominent whistleblower known for outing Bernie Madoff.

Besides Walmart’s surge, Procter & Gamble rose 1.4% and Coca-Cola gained 1.6%.

In Europe, Germany’s DAX sank 0.7%, while France’s CAC 40 lost 0.3%. The FTSE 100 in London dropped 1.1%.

Japan’s Nikkei 225 fell 1.2%, and the Hang Seng in Hong Kong rose 0.8%.

Commodity prices, which have been swinging sharply on worries that a weaker global economy will dent demand, were lower. Benchmark U.S. crude fell 57 cents to settle at $54.66 per barrel. Brent crude, the international standard, lost $1.16 to close at $58.32.

Gold, which has rallied when worries about the economy have grown, added $5.80 to $1,533.60 per ounce.

© The Associated Press. All rights reserved.