U.S. stocks dodged bigger losses and finished barely lower on Wednesday. Health care companies fell and Apple pulled technology companies down, but banks rose.

Earlier in the day, stocks had appeared to be headed for a second day of notable losses, but they recovered some of that lost ground in late trading. Weak earnings for major companies hurt real estate investment trusts and health care companies. Tech stocks slid as investors were unimpressed with Apple’s latest results. Banks continued to report strong earnings and Boeing boosted industrial companies.

ON WALL STREET: At the close, the Dow Jones industrial average was up 30.1 points, about 0.2 percent, at nearly 18,099.3. The Standard & Poor’s 500 index declined 3.7 points, about 0.2 percent, to 2,139.4. The Nasdaq composite slid 33.1 points, about 0.6 percent, to 5,250.3.

OIL PRICES: As markets closed, the price of benchmark U.S. crude was down 81 cents at $49.15 a barrel in electronic trading on the New York Mercantile Exchange. It lost 56 cents, or 1.1 percent, to $49.96 per barrel on Tuesday. In London, the price of Brent crude, the international standard, dropped 84 cents to $49.95 a barrel. It fell 67 cents, or 1.3 percent, to $50.79 a barrel on Tuesday.

Bond prices fell. The yield on the 10-year Treasury note rose to 1.79 percent from 1.76 percent.

ANALYST’S OPINION: Stocks haven’t made many big moves the last two weeks. “Trading volume has really dropped off,” said analyst Scott Wren, a senior global equity strategist at the Wells Fargo Investment Institute. He said investors are being cautious as they wait for the outcome of November’s election.

While individual companies might rise or fall based on their earnings, Wren said investors don’t care that much if overall corporate profits rise or fall this quarter. Earnings have been falling for more than a year but the drops are getting smaller.

advertisement | advertise on newsday

“All the market wants in terms of earnings is a continuation of a pattern this year of quarter-to-quarter improvement,” he said.

APPLE INFLUENCE: Apple sank $2.66, or 2.2 percent, to $115.59 after it reported another drop in iPhone sales. Apple gets about two-thirds of its revenue from the iPhone and some investors are concerned it depends too much on its marquee product. The company expects sales to start growing again in the holiday season after a recent slump.

The losses for Apple, by far the biggest company in the S&P 500, sent tech stocks lower. That canceled out big jumps in Akamai Technologies and Juniper Networks, which each surged more than 10 percent after strong results.

BOEING LOFTS DOW: Boeing climbed $6.52, or 4.7 percent, to $145.54 after the company raised its forecast for earnings, revenue, and plane deliveries. Boeing was responsible for all of the Dow’s gain.

SIMON SLUMP: Simon Property Group, which owns more than 100 shopping malls around the country, slumped after analysts worried about its performance, including lower income from stores that have been open for more than a year. That counteracted solid earnings, and its stock fell $8.89, or 4.5 percent, to $188.38.

EPIPEN COMPETITOR: Drugmaker Mylan fell after Kaleo Pharmaceuticals said it will resume selling its emergency allergy shot Auvi-Q next year. That would mean more competition for Mylan’s EpiPen. Auvi-Q was taken off the market last year because of the potential for inaccurate dosing, leaving EpiPen without any direct competition. Mylan lost 70 cents, or 1.6 percent, to $38.08. The stock is down 22 percent since mid-August as the company has come under fire for repeatedly raising the price of the EpiPen over the last decade and for overcharging the government for the shot.