(AP) -- Major U.S. stock indexes edged higher in afternoon trading Thursday, barely holding on to gains after an early rally lost momentum.
The market's modest pickup comes after two days of losses, which helped keep the S&P 500 on track for its fourth weekly loss and its first monthly decline of the year.
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.
Technology stocks, which have trailed only the energy sector in terms of losses this month, accounted for a big chunk of the market's gains Thursday. Keysight Technologies surged 10.8% after beating analysts' first quarter profit forecasts.
Retailers and restaurant chains also notched solid gains. Dollar General rose sharply after reporting encouraging quarterly results. Home Depot gained 1.1% and McDonald's rose 1.4%.
Clothing and apparel makers were weighed down by weak financial results. PVH, which owns Calvin Klein, plunged after cutting its forecast for the year. Watchmaker Movado Group dropped 4.5% after reporting weak earnings.
Energy stocks fell the most as crude oil prices declined. Benchmark U.S. crude was down 2.9% 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.
With May almost at an end, the S&P 500 is heading for a loss of 5.5%. That would be its first monthly loss since December. The market has been heading steadily lower this month as prospects for the economy have dimmed and as traders got more worried about the lingering trade feud between Washington and Beijing.
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.
The market's monthlong slump 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 around 11.1% for the year, while the technology-heavy Nasdaq composite is up 13.8%.
KEEPING SCORE: The S&P 500 index was up 0.1% as of 1:52 p.m. Eastern time. The Dow Jones Industrial Average was up 19 points, or 0.1%, at 25,146. The Nasdaq composite rose 0.1%
Major stock indexes in Europe rose broadly.
ANALYST'S TAKE: After a rough May, trade concerns will likely continue hanging over the market through most of 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.
WRINKLED FORECAST: PVH, the owner of the Calvin Klein and Tommy Hilfiger brands, plunged 14.2% 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.
PVH said the forecast includes the impact of tariffs. It is the latest retailer suffering from the fallout of the ongoing trade war between the U.S. and China. Retailers have seesawed this week as they express concern over tariffs squeezing their businesses.
Abercrombie & Fitch, Canada Goose and Versace-owner Capri Holdings all gave weak forecasts this week.
DOLLAR DEALS: Dollar General rose 7.5% and Dollar Tree rose 3.7% after the discount retailers gave investors solid quarterly earnings results.
Dollar General beat forecasts for a key sales measure at established stores. It pegged part of that growth to customers buying more groceries and seasonal items.
Dollar Tree matched profit forecasts while beating revenue forecasts for the quarter.
EARNINGS SCORECARD: 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, was scheduled to report its quarterly financial results for the first time later Thursday.
HOMEBUILDERS SLUMP: A surprise decline in pending home sales in April pushed homebuilders mostly lower.
The National Association of Realtors said contracts for home purchases, which are usually completed a month or two later, fell 1.5% last month. Economists expected an increase of 0.9%.
KB Home slid 2.2% and Beazer Homes USA dropped 2.7%.
Copyright 2019 DTN/The Progressive Farmer. All rights reserved.