A day of back-and-forth trading on Thursday ended with the fifth gain in a row for US stocks. Industrial companies like Boeing and General Electric rose, while retailers fell as Macy’s suffered its biggest loss of all time.
Stocks struggled in the early going, and the Dow Jones industrial average lost 175 points after US and Chinese officials wrapped up trade talks in Beijing. Transportation and machinery companies climbed after the US trade representative said China agreed to buy more agricultural and manufactured products.
Macy’s said its sales over the holidays were worse than expected and slashed its annual profit and sales forecasts. Kohl’s and L Brands also posted disappointing results, and a wide variety of retailers plunged as investors worried that the stock market’s December plunge stopped some shoppers from spending as much as they had planned.
‘‘High-end consumers, even though they’re making decent money [and] the economy is going on relatively strong, it may have affected their willingness to splurge over the holidays,’’ said Ken Perkins, president of the research firm Retail Metrics. ‘‘It was not good timing at all.’’
The S&P 500 index added 11.68 points, or 0.5 percent, to 2,596.64. The Dow gained 122.80 points, or 0.5 percent, to 24,001.92 after it fell 175 points in the morning.
The Nasdaq Composite rose 28.99 points, or 0.4 percent, to 6,986.07. The Russell 2000 index of smaller-company stocks picked up 6.63 points, or 0.5 percent, to 1,445.43.
US negotiators said China’s delegation pledged to buy more energy and agricultural products and manufactured goods. That helped Boeing climb 2.6 percent. General Electric jumped 5.2 percent, while Deere rose 3.1 percent.
However, that point is considered a relatively minor area of disagreement, and there were no hints of progress on bigger issues. The United States wants China to change its technology policy to reduce cyber theft of trade secrets and seeks more access to the Chinese market and increased protection for foreign patents and copyrights.
Macy’s said holiday sales slowed in the middle of December, and the department store cut its annual profit and sales forecasts. Its stock plunged 17.7 percent to $26.11 in heavy trading. Macy’s went public in February 1992 and reached an all-time high of almost $73 a share in mid-2015, but four of the five biggest one-day plunges in its history have come in the last three years.
Macy’s announcement came as a surprise because investor expectations for the holiday season have been high. Unemployment is the lowest it’s been in decades, wages are rising, and consumer confidence is high, while gas prices dropped late last year.
In late December, stocks rallied after Mastercard SpendingPulse said shoppers spent $850 billion between Nov. 1 and Dec. 24, an increase of 5 percent from the same time a year earlier.
But the stock market fell sharply in October and then took a dramatic drop over the first three weeks of December. Shortly afterward the federal government went into a partial shutdown that is still ongoing.
While large numbers retailers took steep losses Thursday, Perkins said the market turmoil is a much bigger problem for companies like Macy’s because most stocks are owned by relatively wealthy people. That means big-box stores and companies that sell less expensive goods won’t be affected as much, as shown by Target’s stronger sales report. Perkins added that said Amazon likely had a ‘‘stellar’’ holiday season.
Chip makers rose and other technology stocks edged higher, while high-dividend stocks like utilities and household goods companies made strong gains.
Oil prices extended their rally to a ninth consecutive day. US crude added 0.4 percent to $52.59 a barrel in New York. It’s now up 23.7 percent since hitting an 18-month low on Dec. 24. Brent crude, the international standard, slid 0.4 percent to $61.68 in London.
Federal Reserve chairman Jerome Powell was interviewed at the Economic Club of Washington. Stocks briefly fell after Powell said he expects the Fed’s $4 trillion bond portfolio to shrink until it is ‘‘substantially smaller than it is now.’’ Powell noted the Fed had about $1 trillion on its balance sheet before the 2007-08 financial crisis.
The Fed’s bond holdings are slowly shrinking, which tends to put upward pressure on long-term interest rates. Investors have grown concerned about the effects of those tighter credit conditions as the global economy slows. Powell said in December that the Fed could slow the changes to its portfolio if necessary.
Bond prices slipped. The yield on the 10-year Treasury note rose to 2.74 percent from 2.72 percent.