Stocks closed higher yesterday, after comments by President Barack Obama made investors optimistic that a quick deal could be made to avoid the "fiscal cliff."

"We can probably solve this in about a week, it's not that tough," Obama said in lunchtime remarks to the Business Roundtable in Washington. The comments, just before noon, pushed the market higher, said Quincy Crosby, a market strategist at Prudential Financial.

advertisement | advertise on newsday

The Dow Jones industrial average rose 82.71 points to end at 13,034.49.

Stocks have largely traded sideways for two weeks as investors wait for developments from Washington on budget talks to avoid the "fiscal cliff," a series of government spending cuts and tax increases scheduled to start Jan. 1 unless an agreement is reached to cut the budget deficit.

The Standard & Poor's 500 index was up 0.16 percent to 1,409.28. The Nasdaq composite index fell 0.77 percent to 2,973.70, held back by a slump in Apple.

Apple was among the biggest decliners, falling $37.05, or 6.43 percent, to $538.79.

Aaron Rakers of Stifel Financial said the drop was, in part, due to comments from AT&T Mobility CEO Ralph de La Vega, suggesting that smartphone activations this quarter were lagging the same period a year ago.