NEW YORK — 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.

Stocks haven’t made many big moves the last two weeks. “Trading volume has really dropped off,” said 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.

The Dow Jones industrial average added 30.06 points, or 0.2 percent, to 18,199.33. In early trading it fell more than 100 points. The Standard & Poor’s 500 index sank 3.73 points, or 0.2 percent, to 2,139.43. The Nasdaq composite shed 33.13 points, or 0.6 percent, to 5,250.27.

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.

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

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.