Stocks held on to modest gains on Wall Street in afternoon trading Wednesday after an early rally led by technology companies lost some momentum.
Investor optimism over a new round of trade talks between the U.S. and China helped fuel the wave of buying in technology stocks, particularly chipmakers. The sector is especially vulnerable to trade disruptions with China, the world's second largest economy.
Stocks climbed after U.S. Treasury Secretary Steven Mnuchin told CNBC that a trade deal between the two nations was "about 90%" done during recent negotiations. President Donald Trump and Chinese President Xi Jinping are scheduled to meet at the G-20 summit this weekend and investors hope that talks will yield progress toward an agreement to resolve the costly trade war.
"Optimism is growing that at least negotiations will progress on a viable path toward an agreement," said Quincy Krosby, chief market strategist at Prudential Financial. "The market does not want to see that they leave the G-20 meeting and there's no hope, no change for negotiations."
The escalating trade dispute remains the biggest source of uncertainty looming over the market. Investors are worried the fallout from the tariffs could hurt global economic growth and corporate profits.
Even after losing some strength in afternoon trading, technology companies accounted for much of the market's overall gains. Apple gained 2%.
Micron Technology was the biggest gainer in the S&P 500 after the chipmaker forecast improved demand for smartphone chips the rest of the year. Other chipmakers also posted solid gains.
Energy stocks rose as the price of U.S. crude oil climbed 2.7%. Hess and ConocoPhillips each added 5.1%.
Several big banks rose as bond prices fell, sending yields higher. When bond yields rise it helps banks' ability to charge higher interest on loans. JPMorgan Chase gained 0.8% and Citigroup rose 0.8%.
Health care stocks were the biggest drag on the market, with drugmakers leading the way lower for the sector. Eli Lilly dropped 3.4% and Nektar Therapeutics dropped 2.4%.
Consumer products companies also headed lower. J.M. Smucker dropped 3.4%.
General Mills slumped after the packaged foods maker's latest quarterly results topped Wall Street's expectations, but it also reported weak sales trends in North America.
KEEPING SCORE: The S&P 500 index was up 0.1% as of 2:14 p.m. Eastern Time. The Dow Jones Industrial Average rose 53 points, or 0.2%, to 26,601. The index had been up as much as 111 points.
The Nasdaq composite, which is heavily weighted with technology stocks, gained 0.5% and the Russell 2000 index of smaller company stocks was flat.
The market is coming off a three-day losing streak, though it is on track to end June with solid gains. The benchmark S&P 500 index is about 1.1% below the record high it set on Thursday.
Major stock indexes in Europe were mostly lower.
ALL ABOUT TRADE: This week's G-20 meeting in Osaka, Japan, is the first opportunity Trump and Xi have had to thrash out the trade dispute face-to-face since Trump said he was preparing to target the $300 billion in Chinese imports that he hasn't already hit with tariffs, extending them to everything China ships to the United States.
The two sides are in a stalemate after 11 rounds of talks that have failed to overcome U.S. concerns over China's acquisition of American technology and its massive trade surplus. China denies forcing U.S. companies to hand over trade secrets and says the surplus is much smaller than it appears once the trade in services and the value extracted by U.S. companies are taken into account.
How the trade war develops could affect whether central banks move in to support the economy. Fed Chairman Jerome Powell this week noted that the economic outlook has become cloudier since early May amid uncertainty over trade and global growth. The Fed and the European Central Bank have indicated they are open to cutting interest rates if needed.
FEELING CHIPPER: Chipmakers rose broadly after Micron Technology reported solid quarterly results.
Micron said demand should pick up in the second half of the year, noting it has begun selling products to Huawei that Micron has determined are excluded from the Trump administrations' ban on the sale of technology by U.S. companies to the Chinese telecom giant.
Micron shares vaulted 13.4%. Advanced Micro Devices climbed 3.7%, Nvidia gained 5.4% and Intel added 3%.
HEALTH SECTOR POLITICS: The televised Democratic presidential candidate debates on Wednesday and Thursday evening may weigh on health care stocks.
Many of the candidates have been arguing for expanding Medicare to cover uninsured Americans of all ages or some other form of universal health care coverage that would run counter to the current private insurance market.
"If 'Medicare For All' does not get a lot of air time or if other candidates criticize the proposal, we think that will be a positive for the market," Raymond James analyst Chris Meekins wrote in a research note Wednesday.
Several health care providers were trading lower ahead of the first debate. UnitedHealth Group slid 1.3%, Anthem dropped 1.9% and Centene lost 2.2%.
NOT ENTIRELY APPETIZING: General Mills slid 4.2% after the maker of Cheerios cereal, Yoplait yogurt and other packaged foods reported quarterly results that exceeded Wall Street's expectations, but also reported weak sales trends in North America.
Before you consider UnitedHealth Group, you'll want to hear this.
MarketBeat keeps track of Wall Street's top-rated and best performing research analysts and the stocks they recommend to their clients on a daily basis. MarketBeat has identified the five stocks that top analysts are quietly whispering to their clients to buy now before the broader market catches on... and UnitedHealth Group wasn't on the list.
While UnitedHealth Group currently has a "Moderate Buy" rating among analysts, top-rated analysts believe these five stocks are better buys.
View The Five Stocks Here
Which stocks are likely to thrive in today's challenging market? Click the link below and we'll send you MarketBeat's list of ten stocks that will drive in any economic environment.
Get This Free Report