Stocks rose in choppy trading on Thursday but then fell back again as investors tried to balance strong July retail sales data and Walmart’s upbeat results with continuing concerns about the economy slipping into recession.

Before 10 a.m., the Dow Jones Industrial Average was up 58.86 points, or 0.23%, at 25,538.28 — but then slipped down 0.04% to 25,469.52.

The S&P 500 was up 7.86 points, or 0.28%, before dropping to 0.03% to 2839.73, while the Nasdaq recently traded down 0.25% to 7754.66

“It doesn’t matter where we are right now. The number of variables affecting this market are increasing,” said Andre Bakhos, managing director at New Vines Capital LLC in Bernardsville, New Jersey

The Commerce Department said retail sales rose 0.7% in July, well above expectations of a 0.3% rise, as consumers bought a range of goods even as they cut back on motor vehicle purchases.

“The July number shows that the weakest economic data that people keep pointing out to for a global slowdown is coming from outside the US, not inside the US,” said Randy Frederick, vice president of trading and derivatives for Charles Schwab in Austin.

Walmart Inc. shares rose 5.3% after the retailer reported second-quarter US comparable sales that beat estimates and boosted its earnings forecast for the year.

The company’s strong report lifted the consumer staples sector up 0.98%, the most among the S&P sectors.

Keeping investors on edge were mixed reports on trade.

China’s finance ministry said it would retaliate to the latest US tariffs. However, a spokeswoman for the ministry later said, “We hope the US will meet China halfway, and implement the consensus of the two heads of the two countries in Osaka.”

Trade worries have plagued financial markets for at least a year, fueling fears of recession and prompting traders to raise their bets on three rate cuts this year, including one in September.

The benchmark S&P 500 is now about 6% away from its all-time high hit in July.