* Homebuilders rise after data shows continued price gains
* Washington's budget squabbles expected to spark volatility
* Applied Materials shares rise on merger with Tokyo Electron
* Facebook leads Nasdaq on report it could be allowed in China
* Indexes up: Dow 0.17 pct, S&P 0.24 pct; Nasdaq up 0.51 pct
By Chuck Mikolajczak
NEW YORK, Sept 24 U.S. stocks edged higher after three straight declines on Tuesday after housing data pointed to a slowly improving economy, while investors grew more cautious over the possible impact of budget negotiations in Washington.
The S&P 500 index had dropped for three straight sessions, its longest losing streak in a month and only the fifth time this year the index has suffered such an extended decline.
"We are seeing that once again where, after some weakness, the buyers do kind of dip their toes in," said Ryan Detrick, senior technical strategist at Schaeffer's Investment Research in Cincinnati, Ohio.
Tea Party-backed U.S. senators threatening to stall a bill to fund the U.S. government ran into a wall of resistance late Monday from top Senate Republicans, including Minority Leader Mitch McConnell.
However, the refusal by the Senate Republican leaders to go along did not remove the chance of a government shutdown. Signs still pointed to a frantic last-minute showdown that will determine whether the U.S. government stays open next week. Republicans want to cancel funding for "Obamacare," President Barack Obama's healthcare law.
While many on Wall Street expected an eventual government shutdown to be short and not affect markets deeply, volatility was expected.
"You know anytime the government gets involved, it is going to be the eleventh hour before they decide anything, so that is going to potentially cause some volatility and anxiousness," Detrick said.
U.S. home prices rose 0.6 percent in July on a seasonally adjusted basis, the S&P/Case Shiller composite index of 20 metropolitan areas showed. That was a slightly slower pace than forecast but a separate report from the U.S. Federal Housing Finance Agency showed U.S. home prices rose 1 percent.
Lennar shares gained 5.5 percent to $36.43 after the No. 3 U.S. homebuilder reported a better-than-expected quarterly profit. The earnings, coupled with the economic data, helped the PHLX housing sector index climb 2.9 percent.
In other economic news, a dip in consumer confidence reflected the potential impact higher interest rates and a sluggish economy could have on the housing market.
The data failed to remove investor uncertainty about another concern: the Fed's intentions about scaling back its stimulus efforts. The Fed cited the budget and debt ceiling negotiations in Washington as a reason to keep its current stimulus intact.
The Dow Jones industrial average rose 26.52 points or 0.17 percent, to 15,427.9, the S&P 500 gained 4.02 points or 0.24 percent, to 1,705.86 and the Nasdaq Composite added 19.093 points or 0.51 percent, to 3,784.381.
Facebook shares led the Nasdaq higher, up 3.7 percent to $48.99 after the South China Morning Post reported the online social media giant and other websites deemed sensitive and blocked by the Chinese government will be accessible in a planned free-trade zone in Shanghai. In addition, Citigroup upgraded the stock to a "buy" rating.
Shares of Applied Materials jumped 7.6 percent to $17.20 after the chipmaker and Tokyo Electron Ltd said they will merge in an all-stock deal, creating a $29 billion company.
Red Hat shares slumped 10.7 percent to $47.26 as the worst performer on the S&P 500 after the world's largest commercial distributor of the Linux operating system reported late on Monday a slower growth in billings than analysts had expected.