NEW YORK (AP) -- Stocks cinched their fourth consecutive gain Wednesday as indexes around the world build on their early 2019 rally. The gains for U.S. indexes faded slightly after President Donald Trump and Democratic leaders said Trump cut short a meeting on ending the partial shutdown of the federal government.
The last four-day winning streak for the S&P 500 ended in mid-September. The index, the benchmark for many mutual funds, retirement plans and investment professionals, has climbed 9.9 percent since Dec. 24.
Negotiators from the U.S. and China extended their trade talks to a third day, which investors took as a sign the trade discussions were productive even though the two sides didn't announce any breakthroughs. Stocks linked to faster economic growth, such as technology and energy companies, kept rising.
Oil prices rose for the ninth day out of 10, bringing U.S. crude back above $50 a barrel for the first time in almost a month. European stocks made solid gains and Asian indexes jumped.
Wednesday's rally thinned when Trump tweeted that his meeting with Congressional leaders was a "waste of time," while top Democrats said Trump left after they didn't agree to fund the border wall Trump has demanded.
The partial government shutdown has lasted almost three weeks, meaning 800,000 federal employees are temporarily out of work or working unpaid. Because many federal agencies are shuttered, the government can't send out a variety of payments, government-backed mortgage loan applications aren't being approved, companies can't go public on stock exchanges and a number of economic reports watched by investors aren't being released.
U.S. Bank Wealth Management chief equity strategist Terry Sandven said the economy looks solid, but this year is likely to be a bumpy one for stocks because investors will be very sensitive to trade threats and signs of slower growth.
"We're in this roller-coaster mode," he said. "We're in a trading range that we'll be in for the course of the year."
The S&P 500 index climbed 10.55 points, or 0.4 percent, to 2,584.96. The Dow Jones Industrial Average picked up 91.67 points, or 0.4 percent, to 23,879.12. The Nasdaq composite rose 60.08 points, or 0.9 percent, to 6,957.08. The Russell 2000 index of smaller and U.S.-focused stocks added 12.25 points, or 0.9 percent, to 1,438.81.
Sandven said stocks could keep rising next week as U.S. corporations start to report their fourth-quarter results, as their profits are expected to rise compared to last year.
"You still have moderating earnings growth, non-problematic inflation and relatively low interest rates," he said.
Experts think the trade negotiations will have to continue for months before an agreement is reached. The Trump administration wants the government of President Xi Jinping to alter its handling of technology held by foreign companies, and while Chinese officials have suggested they could revise some of their industrial plans, they say they won't abandon larger goals that they consider a path to prosperity and global influence.
Chipmaker Micron Technology surged 5.6 percent to $35.93 and competitor Broadcom climbed 3.7 percent to $244.77. Many chip companies have manufacturing operations in China and make big chunks of their sales there. Traders felt that made them especially vulnerable in the U.S.-China spat. They were also concerned about an abrupt slowdown in the global economy and the possibility that supplies were too large.
The Philadelphia Semiconductor index sank 25 percent from early June to late December before a recent recovery.
In overseas trading, Germany's DAX and the French CAC 40 each added 0.8 percent and Britain's FTSE 100 gained 0.7 percent. Japan's Nikkei 225 gained 1.1 percent and the Hang Seng in Hong Kong rallied 2.3 percent.
Oil prices hit their highest in almost a month after rising for the ninth day in the last 10. U.S. crude rose 5.2 percent to $52.36 a barrel in New York. It's jumped 15 percent so far in 2019. Brent crude, used to price international oils, added 4.6 percent to $61.44 a barrel in London.
Lennar jumped 7.9 percent to $46.29 and other homebuilders also rose after CEO Stuart Miller said more potential buyers have been coming to Lennar's model homes recently as mortgage rates dipped. That could be a sign sales will pick up.
Homebuilder stocks took huge losses in 2018 as high prices and increasing mortgage rates hurt sales.
Bond prices recouped an early loss and wound up little changed. The yield on the 10-year Treasury note remained at 2.71 percent.
With investors becoming a bit more optimistic about trade and economic growth, high-dividend stocks including utilities and food, drink and household goods makers fell. Beer and wine maker Constellation Brands slumped after it cut its annual profit forecast, saying it now expects sales and profits for its wine and spirits division to fall in the current fiscal year. The stock slumped 12.4 percent to $150.894.
The Corona maker also said it wrote down the value of its $4 billion investment in Canadian marijuana producer Canopy Growth by $164 million. Pot stocks proved popular as Canada legalized recreational marijuana and companies like Constellation and Altria announced partnerships with growers. But the stocks have been extremely volatile. After strong gains early in 2018, Canopy stock has dropped 40 percent since mid-October.
In other commodities trading, wholesale gasoline rose 4.6 percent to $1.43 a gallon and heating oil added 2.9 percent to $1.88 a gallon. Natural gas edged up 0.6 percent to $2.98 per 1,000 cubic feet.
Gold rose 0.5 percent to $1,292 an ounce. Silver inched up 0.1 percent to $15.74 an ounce and copper was unchanged at $2.66 a pound.
The dollar slipped to 108.28 yen from 108.65 yen. The euro climbed to $1.1544 from $1.1443.