NEW YORK - Whipsawed by strong earnings from some companies, weak ones from others, including the once-infallible Apple, investors couldn't make up their mind whether to buy or sell on Wednesday. In the end, they mostly sold, but barely.
The Standard & Poor's 500 slipped 0.42 points, or 0.03 percent, to end at 1,337.89. The tiny loss extended the broad index's losses to a fourth straight day. A big reason was Apple, which dropped $22.12 to $578.80, a loss of 4 percent. A sharp drop in new home sales also fed the selling.
The Dow Jones industrial average rose 58.73 points, or 0.5 percent, to 12,676.05. That snapped a three-day, triple-digit losing streak for the index.
Helping the Dow were big gains from two of its components, Boeing and Caterpillar. The duo contributed 24 points to the index, or nearly half of its gain.
Boeing rose $2, nearly 3 percent, to $74.03 after reporting surprisingly strong earnings. The aircraft maker also raised its profit forecast for all of 2012.
Caterpillar, which makes mining and construction equipment, rose $1.17, or 1.4 percent, to $82.60. The company blew away analysts' estimates with a 67 percent surge in profits for the second quarter. Caterpillar credited strong sales of mining equipment overseas and a strengthening housing market.
Shortly after Caterpillar announced its results, the optimism about housing took a hit. The Commerce Department said sales of new homes plunged 8 percent last month, the steepest drop since February last year. Sales in the northeastern U.S. plummeted 60 percent. The decline suggests a weaker job market is dampening any pickup in the industry.
"Housing is not really recovering, it's bottoming," said Steven Ricchiuto, chief economist at Mizuho Securities, a brokerage firm. "That's still a problem with the economy."
Home builders were hit hard. Beazer Homes fell 13 cents, or 5 percent, to $2.35.