Stocks rose for the fourth straight day on Tuesday as an upbeat report on sales of previously owned U.S. homes bolstered hopes for an economic recovery.

But a sell-off in financials on worries about the dilutive impact of recent stock offerings limited a broad advance.

An index of pending sales of previously owned U.S. homes shot up 6.7 percent in April, the biggest monthly gain in 7-1/2 years, according to the National Association of Realtors.

The data suggested that the recession is easing, and investors snapped up shares of home builders, with Toll Brothers rising nearly 4 percent to $19.53, while DR Horton shot up 4.1 percent to $9.63.

The Dow Jones home construction index <.DJUSHB> was up 3.2 percent.

Shares of big manufacturers also rose, with plane maker Boeing Co gaining 3.1 percent and ranking among the Dow's major advancers. Exxon Mobil Corp , 3M Co , Coca-Cola and Alcoa Inc also bolstered the blue-chip average.

Some news is starting to come out that says things are stabilizing and slowly starting to look better, said Dan Faretta, senior market strategist at Lind-Waldock, a retail brokerage firm, in Chicago. We've still got companies going under, filing for bankruptcy, and unemployment is continuing to rise ... but we are starting to finally hit the bottom.

The Dow Jones industrial average <.DJI> added 19.43 points, or 0.22 percent, to 8,740.87. The Standard & Poor's 500 Index <.SPX> gained 1.87 points, or 0.20 percent, to 944.74. The Nasdaq Composite Index <.IXIC> rose 8.12 points, or 0.44 percent, to 1,836.80.

For the S&P 500, the four-day advance represents the index's longest winning streak since early April.

However, trading was volatile, with indexes swinging between gains and losses during the session.

The Dow industrials briefly turned positive for the year, rising as high as 8,787.13, before trimming gains.

The broader market came up against critical resistance a day after the S&P 500 hit a key technical milestone, finishing above its 200-day moving average for the first time since December 2007. Since hitting a 12-year closing low on March 9, the S&P 500 has risen about 40 percent.

Boeing shares rose 3.1 percent to $49.20 and Exxon Mobil climbed 1.6 percent to $72.92, while 3M added 1.1 percent to $59.96, and Coca-Cola gained 1.3 percent to $49.66.

A drop in the U.S. dollar against major foreign currencies also buoyed the shares of multinational companies. The dollar hit fresh lows against the euro on Tuesday as strong housing data weakened its safe-haven appeal.

Oracle Corp rose 2.2 percent to $20.35, making the stock the Nasdaq's top boost, after Chief Executive Larry Ellison said he is considering getting into the business of selling low-cost laptop computers, one of the fastest-growing sectors of the technology business.

Several U.S. banks are raising capital to show they are capable of functioning without government support, in a move to free themselves from tight regulations after they received billions of dollars from the Treasury Department's Troubled Asset Relief Program, or TARP. [ID:nN02502975]

Shares of JPMorgan , which sold $5 billion of stock, fell 4.5 percent to $34.50, putting the bank among the Dow's top drags. Shares of American Express Co dropped 4.9 percent to $24.71 after the credit card company sold $500 million of stock. The KBW bank index <.BKX> fell 1.5 percent.

Volume was moderate on the New York Stock Exchange, where about 1.41 billion shares changed hands, below last year's estimated daily average of 1.49 billion. On the Nasdaq, about 2.41 billion shares were traded, above last year's daily average of 2.28 billion.

Advancers outnumbered decliners on the NYSE by a ratio of 3 to 2, while on the Nasdaq, about five stocks rose for every four that fell.

(Reporting by Ellis Mnyandu; Editing by Jan Paschal)