On a day that brought both good and bad news about the economy, investors chose to see the glass as half-full.
U.S. stocks edged higher through most of Thursday, pushed up by a batch of bright earnings reports and encouraging news about home sales. But the gains were kept in check by a disappointing report on unemployment claims, a decline in some European markets and weakness at big-name companies like Aetna, UPS and Dow Chemical.
According to preliminary calculations, The Dow Jones industrial average closed the trading day up 13.90 points, or 0.87 percent, to 13,204.62. The Standard & Poor's 500 rose 9.29 points, or 0.67 percent, to 1,399.98. The Nasdaq composite index climbed 20.98 points, or 0.69 percent, to 3,050.61.
The National Association of Realtors reported that the number of contracts to buy homes is rising. That pushed up the stocks of home builders like PulteGroup and Lennar. Companies like Lockheed Martin, the aerospace and defense contractor, and Starwood Hotels, which runs chains including Westin and Sheraton, climbed after beating analysts' predictions for first-quarter earnings.
"Progress on the housing market is going to be slow and gradual," said ING's Teunis Brosens. "The pick-up in sales over the past few months appears to be at least partly driven by all-cash buyers."
The pending home sales data is an important clue to existing home sales, Brosens added. "Slowly but surely, the U.S. housing market is climbing out of the abyss."
Still, investors didn't need to look far to find problems, or at least confusion, looming on the horizon.
In the U.S., the government reported that the number of people seeking unemployment benefits was little changed last week, stoking more uncertainty about when and if companies will return to pre-recession levels of hiring.
John De Clue, global investment strategist at U.S. Bank's wealth management business in Minneapolis, was watching the yield on 10-year Italian bonds tick up. That means the Italian government is paying more to persuade investors to hold its bonds, a sign that investors are worried about Italy's ability to repay its debts.
De Clue described the situation in Europe as "two steps forward and one step back."
"Okay, the situation doesn't look as serious as it did back in October," De Clue said. "But it's very difficult to understand what the market looks like with the need for austerity but also the need to avoid a recession."
But Doug Cote, chief market strategist at ING Investment Management in New York, thinks concerns about Europe are overblown. Though the debt crisis isn't solved, he said, the European Central Bank has set up enough safeguards to keep Europe's problems from spilling across the ocean for the near future.
"There's breathing room," Cote said. "I think they get it done no matter what happens with French elections, no matter if the Dutch government dissolves. This is way overplayed."
European markets were mixed, with Germany and Britain's main index rising while Greece, Spain and France fell. Spain's Banco Santander reported disappointing results, heightening concerns that Spain could join Greece, Ireland and Portugal in asking for a bailout.
U.S. companies' earnings reports also underscored the European problem. Dow Chemical, the nation's largest chemical maker, and UPS, the package delivery company, both fell after citing a cooling down of business in Europe.
Despite those declines, first-quarter earnings reports have been mostly positive. About 80 percent of the 202 S&P 500 companies to report earnings so far have beaten analysts' forecasts, according to calculations by John Butters, senior earnings analyst at FactSet. That's better than the past four quarters, which averaged about 72 percent, he said.
Earnings growth has also come in better than expected. Four weeks ago, analysts had expected year-over-year earnings growth of about 0.1 percent. So far, companies have turned in about 5.9 percent.
Butters also noted that earnings are being driven by a few well-known companies, most notably Apple. Strip Apple out of the S&P 500, and earnings growth would drop to 3.6 percent, he calculates. Banks, which have also turned in strong first-quarter earnings, were helped by one-time items like accounting adjustments.
The market had a white-hot ride in the first three months of the year as investors shrugged off the previous year's concerns about Europe and gridlock in Washington over fiscal policy. However, some of those concerns appear to be resurfacing. Wall Street's three main stock indexes are all down so far for the second quarter, which started at the beginning of April.
Natalie Trunow, chief investment officer of stocks at Maryland's Calvert Investments, said investors will probably continue to be cautious until they have more clarity on those and other issues.
"We have an election coming up, we have the expiration of the Bush tax cuts and payroll breaks, we have the budget negotiations coming up soon," Trunow said. "All of this is going to give markets indigestion."
The Associated Press and Reuters contributed to this report.