NEW YORK — Stock indexes came back from deep losses in the morning and ended Wednesday with small gains. The Dow Jones industrial average avoided its longest losing streak since Jimmy Carter was president.
The Dow rose 30 points — after being down 166 — to break an eight-day losing streak. Nine days would have been the longest since February 1978. The Standard & Poor’s 500 rose 6 points and broke a seven-day skid.
Shortly after the market opened, the Institute for Supply Management said its index measuring the service sector of the U.S. economy grew in July at the weakest pace in 17 months. Economists had expected a slight increase.
The report was the latest sign over the past week that the economy may be slowing. Consumers cut their spending in June for the first time in nearly two years, manufacturing slowed, and the government said that in the first half of the year the economy grew at its slowest pace since the recession ended in June 2009.
“There has been too much at the same time for investors to hang in there, and you’re starting to see some element of panic finally showing up,” said Andrew Goldberg, U.S. market strategist at JP Morgan Funds.
The Dow, S&P 500 and Nasdaq were down more than 1 percent earlier in the day but edged higher throughout the afternoon.
The Dow industrials finished with a gain of 0.3 percent, to 11,896.44. The S&P rose 6.29, 0.5 percent, to 1,260.34 and is up 0.2 percent for the year after being down 0.3 percent for the year Tuesday.
The Nasdaq composite added 23.83, 0.9 percent, to 2,693.07.
The broad S&P — the index followed by most professional money managers and U.S. mutual funds — rose after it hit a low for the year of 1,234. Some investors saw it as an opportunity to buy. As a whole, companies in the index are expected to have record profits this year.
“It seems like the early money was based on fear and the market climbed back as computer- program trading took over,” said Mark Lamkin, head of Lamkin Wealth Management in Louisville, Ky.
Early today, Japan intervened in the foreign currency market to stem the yen’s rise against the dollar. The coordinated intervention in international currency markets was the first by the G7 countries since the fall of 2000, when the G7 intervened to bolster the euro.



