NEW YORK (AP) -- 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 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. KB Home lost 32 cents, or 3 percent, to $9.31.
The biggest loser in the S&P was Netflix, the video subscription company. It fell $20.11 to $60.28, a loss of 25 percent. The company reported late Tuesday that its net income plunged 91 percent in the latest quarter. Investors are worried about rising licensing fees and slowing subscriber growth.
Stocks were pushed higher at the opening by the gains in Caterpillar and Boeing. But the disappointing home sales news soon cut into the gains, and trading remained choppy throughout the day.
Apple didn't help. Late Tuesday, the company reported net income rose 21 percent in the second quarter instead of the 33 percent that analysts were expecting. The company said consumers appear to be holding off on buying iPhones before a new model comes out, even though it isn't expected until October.
Apple makes up 12.7 percent of the Nasdaq composite, making it by far the biggest component of the technology-focused index. The Nasdaq lagged the broader market, giving up 0.3 percent, or 8.75 points, to close at 2,854.24.
The bad news from tech stocks didn't end there. After the closing bell, Zynga, the maker of online video games like "Farmville," slashed its forecast for full-year earnings, blaming delays in launching new games, dwindling revenue from existing web games and a "more challenging environment" on the Facebook platform. The stock plunged $2.04, or 40 percent, to $3.05 in after-hours trading.
In other corporate news, computer security provider Symantec soared $1.79 to $14.96. The company announced the departure of its CEO, Enrique Salem, and reported earnings per share and revenue came in well ahead of Wall Street's estimates.
WellPoint, the nation's second largest insurer, lowered its earnings forecast. Its stock fell $7.41, or 12 percent, $54.01, the biggest one-day drop for the stock in more than three years. The insurer said enrollment has been slipping as companies cut jobs.
Corning said its second-quarter profit sank 39 percent on lower sales volumes and prices of its liquid-crystal-display glass products. Its stock fell 93 cents to $11.14, or 8 percent.
Stock in RadioShack plunged $1.05, or 29 percent, to $2.60, an all-time low for the electronics retailer. The company reported an unexpected loss for its second quarter and suspended its dividend.
In Europe, stock indexes mostly higher. A European Central Bank policymaker said the region's bailout fund should be given the power to borrow money from the central bank, increasing its financial resources. That would be necessary if Spain asked for a bailout.
The yield on the Spain's 10-year government bond fell to 7.37 percent from 7.53 percent late Tuesday. That's a positive sign that investors are slightly less worried about Spain's ability to repay its debts.