(AP) -- Major U.S. stock indexes capped a day of listless trading with modest gains Thursday, snapping the market's two-day losing streak.
A late flurry of buying helped lift the indexes, which had spent much of the day moving sideways after an early rally lost momentum. Even so, the market remained on track for its fourth straight weekly loss and its first monthly decline of the year.
Gains in technology, health care and consumer discretionary stocks outweighed losses in energy, financials and other sectors. Bond prices rose again, sending yields lower. Oil and gas prices fell sharply.
Stocks have been sliding in volatile trading all month as investors come to grips with the potential impact that the escalating trade war between the U.S. and China could have on corporate and economic growth. With one day left of trading in May, the S&P 500 is heading for a monthly loss of about 5.3%.
"This 5% or 6% sell-off is really just a resetting of expectations, especially with the sentiment that's been a gloomy overhang," said David Lyon, global investment specialist at J.P. Morgan Private Bank.
The S&P 500 index rose 5.84 points, or 0.2%, to 2,788.86. The Dow Jones Industrial Average gained 43.47 points, or 0.2%, to 25,169.88.
The Nasdaq composite added 20.41 points, or 0.3%, to 7,567.72. The Russell 2000 index of smaller companies fell 4.42 points, or 0.3%, to 1,485.53.
Major stock indexes in Europe rose broadly.
The U.S. stock market's slump in May follows a yearlong run for the S&P 500 that culminated in an all-time high on April 30. The benchmark index is still up 11.2% for the year, while the technology-heavy Nasdaq composite is up 14.1%.
Trade concerns could continue to hang over the market through late June. That's when U.S. and Chinese leaders will have an opportunity to meet at the next G20 summit in Japan.
"We don't expect there to be some grand bargain, but that will definitely set the tone," said Jim Smigiel, chief investment officer of non-traditional strategies at SEI.
Until then, investors will have to deal with more uncertainty over the trade war's impact on global growth, corporate profit results and monetary policy.
In early May the U.S. and China concluded their 11th round of trade talks with no agreement. The U.S. then more than doubled duties on $200 billion in Chinese imports, and China responded by raising its own tariffs.
Technology stocks, which are trailing only the energy sector in terms of losses this month, accounted for a big chunk of the market's gains Thursday. Keysight Technologies led the sector and all other S&P 500 stocks, surging 11.3% after the electronics company's first quarter profits beat analysts' forecasts. Intel rose 1.1% and Qualcomm gained 1.3%.
Health care companies, retailers and restaurant chains also notched gains. Vertex Pharmaceuticals climbed 2.2%. Home Depot gained 1.2% and McDonald's rose 1.6%. Dollar General had its biggest gain in five months after the discount retail chain reported solid quarterly results.
Energy stocks took the heaviest losses as crude oil prices fell sharply on oversupply concerns. The federal government reported that crude stocks fell just under 300,000 barrels last week. Oil trading advisory firm Ritterbusch and Associates expected a decline of 2 million barrels. Chevron slid 1.2% and Marathon Petroleum dropped 3.8%.
Banks fell as bond prices rose, sending bond yields lower. When bond yields decline they pull down interest rates, making loans less profitable. Bank of America slid 2.1% and Capital One Financial lost 1.2%.
The yield on the benchmark 10-year Treasury note fell to 2.22% from 2.23% late Wednesday. The yield has been at the lowest level in nearly two years since Tuesday. Lower bond yields are typically a sign that investors are worried about weakening economic growth.
Investors had their eye on a mixed batch of corporate earnings reports Thursday.
Dollar General rose 7.2% and Dollar Tree gained 3.1% after the discount retailers gave investors solid quarterly earnings results.
Some retailers put investors in a selling mood.
PVH, the owner of the Calvin Klein and Tommy Hilfiger brands, plunged 14.9% after cutting its full year profit forecast because of weak sales. PVH cited weak sales in the U.S. and China and put some of the blame on the ongoing trade war between the world's two biggest economies. Abercrombie & Fitch, Canada Goose and Capri Holdings, which owns Versace, all gave weak forecasts this week.
Nearly all of the companies in the S&P 500 have reported their latest round of quarterly financial results. Analysts had issued dire warnings for a severe earnings contraction early this year, but the results have been surprisingly good.
Overall, profit contracted less than a half-percentage point. That's far better than the 4% drop Wall Street expected.
A few companies have yet to report results. Ride-hailing company Uber, which went public earlier in May, reported late Thursday that it booked $1 billion in losses for its fiscal first quarter, even as its revenue jumped 20% from a year earlier.
Energy futures closed broadly lower Thursday. Benchmark U.S. crude skidded 3.8% to settle at $56.59 a barrel. Brent crude oil, the international standard, closed 3.7% lower at $66.87 per barrel.
Wholesale gasoline slid 3.4% to $1.88 per gallon. Heating oil dropped 2.7% to $1.92 per gallon. Natural gas gave up 2.9% to $2.55 per 1,000 cubic feet.
Gold gained 0.5% to $1,292.40 per ounce, silver added 0.6% to $14.49 per ounce and copper fell 0.4% to $2.65 per pound.
The dollar rose to 109.55 Japanese yen from 109.46 yen on Wednesday. The euro strengthened to $1.1135 from $1.1133.
Copyright 2019 DTN/The Progressive Farmer. All rights reserved.