Stocks finished broadly higher for the third day in a row Monday. Media, retail, and technology companies rose, and Warren Buffett’s Berkshire Hathaway led gains for the financial sector. Most sectors climbed as companies including Facebook and Netflix recovered some of the losses they sustained recently. Investors continued to focus on companies’ quarterly results instead of the escalating trade threats the United States and China made last week.
Company profits have rocketed higher this year thanks to the corporate tax cut and continued economic growth. But in the first quarter investors didn’t always react to that growth because they were worried about the nation’s numerous trade disputes. Julian Emanuel, chief equity and derivative strategist for BTIG, said that’s starting to change.
‘‘The skepticism that we had a quarter ago seems, rightly, to be falling by the wayside,’’ he said.
The S&P 500 index rose 0.4 percent, to 2,850.40, its highest close since Jan. 29. The benchmark index has risen for five weeks in a row, its longest winning streak in 2018.
The Dow Jones industrial average gained 0.2 percent, to 25,502.18. The Nasdaq Composite added 0.6 percent, to 7,859.68. The Russell 2000 index of smaller-company stocks picked up 0.7 percent, to 1,684.31.
Facebook helped pull technology companies upward as it gained 4.4 percent. The Wall Street Journal reported that Facebook has talked to four major US banks about possibly offering new services through Facebook Messenger.
Results for Berkshire Hathaway were stronger than analysts expected, and the company’s Class B shares climbed 2.9 percent.
Jacobs Engineering jumped 7.8 percent after it gave a strong forecast for its next fiscal year.
Tyson Foods gained 3.3 percent; it cut its profit forecast last week in part because of uncertainty surrounding trade policy and rising freight costs. Its stock is down 26 percent this year.
Newell Brands dropped 14.3 percent; it said the liquidation of Toys “R” Us hurt its baby products business. The company also said the combination of US tariffs on goods from China and tariffs imposed by the European Union and Canada following the US taxes on imported steel and aluminum could cost it as much as $100 million a year.
The S&P 500 is getting close to its most recent closing high of 2,872, set Jan. 26. Emanuel said the index might be at 3,000 now, about 5 percent higher than it was Monday, if not for the ongoing trade disputes. He said the S&P could reach that mark if the trade disputes end, but added that that trading could become volatile this fall if there isn’t progress.
‘‘There is a hope and there is an expectation . . . that you are going to favorably resolve the trade issues,’’ he said.
Rite Aid plunged 9.8 percent after it forecast a bigger loss for the year because generic drug pricing isn’t shaping up the way it expected. This week shareholders will vote on the proposed sale of Rite Aid to the Albertsons grocery store chain. The owner of Safeway agreed to buy Rite Aid in February, but two shareholder advisory firms and one major Rite Aid shareholder opposed the deal.
PepsiCo said Indra Nooyi will step down as its CEO in October after 12 years leading the company. Ramon Laguarta, Pepsi’s head of corporate strategy, will become its next CEO. The stock rose 0.9 percent.
Oil futures gave up most of an early gain, but still finished higher. Benchmark US crude rose 0.8 percent to $69.01 a barrel in New York. Brent crude, used to price international oils, rose 0.7 percent to $73.75 in London.
Regulators in China tightened controls on trading in the yuan in a possible effort to stop its decline against the dollar. The yuan has drifted lower against the dollar since February, which could help Chinese exporters that face higher US tariffs but also raises the risk of capital flowing out of the economy.
The British pound weakened after the United Kingdom’s trade minister warned the country risks leaving the European Union without a deal to avoid tariffs and other trade barriers. The currency fell to $1.2944, its lowest in almost a year, from $1.3007 Friday.
The dollar rose to 111.40 yen from 111.23 yen. The euro fell to $1.1556 from $1.1578.
Bond prices rose. The yield on the 10-year Treasury note fell to 2.94 percent from 2.95 percent.