Stocks ended a wobbly day mostly higher as gains for technology and health care stocks offset losses in the energy sector and more in Tuesday’s Stock Market Update.

U.S. crude oil prices slid almost 4% a day after OPEC agreed to extend current production levels for nine months. The slide in energy companies and losses in banks and other sectors outweighed gains in communications services, real estate and utilities stocks.

Trading was relatively quiet ahead of Wednesday’s half day of trading for U.S. markets and Thursday’s closure for Independence Day.

Investors were mulling over what exactly will come of the latest truce in the U.S.-China trade war. Presidents Donald Trump and Xi Jinping of China agreed to over the weekend to resume trade negotiations.

The United States also agreed not to impose additional tariffs on the world’s second-largest economy, and the detente is good news for markets. But tariffs in place have already hurt global economic growth, and investors see that the two sides still face the same differences that caused talks to break down earlier.

Wall Street’s gains in the first half of the year were marked by months of volatile trading as investors rode the ups and downs of the trade war. That volatility is unlikely to fade as Washington and Beijing move forward with another round of negotiations.

STOCK MARKET UPDATE

KEEPING SCORE: The S&P 500 index rose 8 points, or 0.3%, to 2,973. The Dow Jones Industrial Average rose 69 points, or 0.3%, to 26,786. The Nasdaq added 17 points, or 0.2%, to 8,109. Small-company stocks fell.

Major stock indexes in Europe rose.

WHAT’S NEXT: Companies are lining up to tell investors in upcoming weeks how much profit they made during the spring. Expectations are generally low, and this could be the first time in three years that S&P 500 companies report a back-to-back decline in overall earnings, according to FactSet.

Besides the earnings reports, the next big milestone for markets may be the Federal Reserve’s meeting at the end of July. There, many investors expect the Fed to cut interest rates for the first time since the Great Recession in 2008 in the face of slowing economic momentum around the world.

BEEN HERE BEFORE? “Yesterday’s optimism in equity markets is beginning to look a little over-eager, with some already drawing worrying parallels to the November 2018 G-20 summit, which was followed up by a dramatic fall for equities,” said Chris Beauchamp, chief market analyst at IG.

“The past is not prologue, and the central bank outlook is very different to the end of 2018, as easing comes back on to the agenda, but with volumes drying up ahead of Independence Day and the next earnings season rapidly approaching equities are looking vulnerable to some near-term weakness.”

YIELDS: The yield on the 10-year Treasury note fell to 1.98% from 2.03% late Monday and is close to its lowest level since the 2016 election. Yields have been falling since last autumn on worries about a slowing economy and as expectations have climbed for a rate cut by the Federal Reserve.

When bonds are offering lower yields, the regular payments of high-dividend stocks start to look more attractive. Real-estate stocks and utilities were among the biggest gainers in the S&P 500.

Entergy rose 1.6% and Duke Realty added 1.4%.

The decline in bond yields weighed on banks. When yields decline they push down interest rates that banks charge for mortgages and other loans, cutting into their profits. Citizens Financial Group dropped 1.7% and Capital One Financial slid 1%.

DIM SALES: Lighting company Acuity Brands sank 7.8% despite reporting stronger profit for its latest quarter than analysts expected. Revenue was below expectations, and the company cited “ongoing angst generated by trade policy issues” in the market.

TAKING OFF: Delta Air Lines climbed 1.3% after it gave a profit forecast for the just-completed quarter that was stronger than analysts had been expecting. The carrier said revenue during the quarter was at the high end of its initial expectations, while costs outside of fuel were up just 1% to 2%.

COMMODITIES: Benchmark U.S. crude oil slumped $1.90, or 3.2%, to $57.19 per barrel. Brent crude, the international standard, lost $1.80 to $63.26.

The drop for crude hurt oil stocks, which had the market’s biggest declines. Energy stocks in the S&P 500 fell 1.7%, triple the loss of any of the other 10 sectors that make up the index. Halliburton dropped 1.2%, Occidental Petroleum fell 1.9% and ConocoPhillips lost 3.4%.

The price of gold rose $18.10, or 1.3%, to $1,407.20 per ounce.

© The Associated Press. All rights reserved.