US stocks edged higher Friday as gains from energy companies, industrial firms and smaller companies helped the market end a modest losing streak.
Oil and gas companies climbed along with the price of oil while industrial companies recovered some of the losses they sustained earlier this month.
Beauty products retailer Ulta and software company Adobe rose after strong quarterly reports.
Tiffany dropped after reporting weak sales, and online retailers Overstock.com and Wayfair slumped as investors worried about a possible price war.
All this week, stocks moved higher in early trading only to shed those gains as the day went on.
They broke out of that pattern Friday, even though the gains were modest.
"From an investor point of view, the fact that we haven't rallied right back to the highs is a good thing," said Randy Frederick, vice president of trading and derivatives at Charles Schwab.
Positive news about the economy has been countered by concerns about rising tensions over international trade.
"The pullback that we've been in is pretty much driven by President Trump's proclamation about tariffs," Frederick said.
The S&P 500 index gained 4.68 points, or 0.2%, to 2,752.01.
The Dow Jones industrial average added 72.85 points, or 0.3%, to 24,946.51.
The Nasdaq composite rose 0.25 points to 7,481.99. The Russell 2000 index of smaller-company stocks jumped 9.43 points, or 0.6%, to 1,586.05.
After a dramatic drop at the beginning of February followed by a rapid recovery of some of their losses, stocks have bounced around for the last month.
The Dow, which surged past 26,000 in mid-January, has been wobbling around 25,000 for about a month.
The S&P 500 fell for the first four days of the week and finished with a decline of 1.2%.
The worst losses came Tuesday and Wednesday after President Donald Trump blocked Singapore-based chipmaker Broadcom's effort to buy its US rival Qualcomm and European leaders warned about the risks of trade disputes.
The Federal Reserve said factory output continued to rise as companies in the US produced more cars, computers and furniture.
It reported that manufacturing output rose 1.2% in February after three months of weak results. Factory output has increased 2.5% over the last year.
The Commerce Department said homebuilders started work on fewer apartment buildings in February, and that caused overall housing starts to drop 7%.
Tiffany dropped 5.20 dollars, or 5.1%, to 97.51 dollard after it reported weaker sales than analysts expected. Its forecast for the current year was also below what investors were looking for.
Online discount retailer Overstock.com said profit margins have fallen hard because of competition with Wayfair, and chief executive Patrick Byrne said the company will "respond in kind," meaning Overstock will try to ramp up its growth and will be willing to lose money to achieve that goal.
The stock dropped 2.50 dollars, or 5.2%, to 45.70 dollars while Wayfair lost 5.01 dollars, or 6%, to 78.95 dollars.
While Broadcom is no longer trying to buy rival chipmaker Qualcomm, both companies are still at the centre of deal discussions.
The Financial Times reported that former Qualcomm chairman Paul Jacobs wants to take the company private and has had talks with potential investors and the Qualcomm board. Qualcomm added 73 cents, or 1.2%, to 60.62 dollars, which gives it a market value of about 90 billion dollars.
With the Qualcomm deal finished, Broadcom says it still sees opportunities for other acquisitions. The company also disclosed its quarterly results, and its shares fell 12.89 dollars, or 4.8%, to 254.87 dollars.
The top policymakers at the Federal Reserve will meet Tuesday and Wednesday, and they are expected to raise interest rates again.
Since the market is fairly sure of what the Fed will do, there will be a lot of focus on what it says.
After the meeting ends, chairman Jerome Powell will hold his first news conference since he replaced Janet Yellen last month.
Bond prices fell. The yield on the 10-year Treasury note rose to 2.84% from 2.83%.