Stocks racked up a fourth straight week of gains on Thursday, as investors expected optimism about the economic recovery to support equities through year-end.

The S&P 500 ticked lower on Thursday, the close of a holiday-shortened week, breaking five days of gains, in the lowest volume in a full-day session this year. Banks dragged on the market, giving back recent gains after a strong month.

Some technical and sentiment indicators auger for a near-term drop in stocks, but investors remain optimistic over the long haul.

Keith Springer, president of Springer Financial Advisors in Sacramento, California, said the market is more likely to trade sideways than fall dramatically.

A sideways move can work off an overbought condition, said Springer. Just the fact that it slows down and moves sideways is almost a corrective pattern for the stock market.

Economic data was mixed. Consumer sentiment rose in December to its highest level since June, and demand for long-lasting manufactured goods surged. First-time claims for jobless benefits edged down, but a rise in new home sales in November came in below expectations.

The KBW Bank index <.BKX> eased 0.9 percent following a month-long rally that had boosted the index by 15.7 percent for December.

Bank of America Corp lost 2.4 percent to $13.06 and JPMorgan Chase & Co fell 0.2 percent to $42.00.

The Dow Jones industrial average <.DJI> added 14.00 points, or 0.12 percent, to 11,573.49. The Standard & Poor's 500 Index <.SPX> edged down 2.07 points, or 0.16 percent, at 1,256.77. The Nasdaq Composite Index <.IXIC> eased 5.88 points, or 0.22 percent, to 2,665.60.

For the week, the S&P 500 was up 1 percent, the Dow gained 0.7 percent and the Nasdaq rose 0.9 percent. It was the fourth week of gains for the Dow and S&P and the fifth week of gains for the Nasdaq.

The latest American Association of Individual Investors' survey found bullish sentiment rose 13.1 percentage points to 63.3 percent, as of December 23, a six-year high.

Volume was the lightest of the year with just 4.56 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq as Wall Street prepared for a break on Friday for the Christmas holiday.

Market watchers say the market is likely to see more upside in the remaining five trading days of the year after a 6.5 percent gain for the month put the S&P 500 up 12.7 percent for 2010.

According to Birinyi Associates Inc, the market rallies 73 percent of the time from the close before Christmas Day to the last close of the year for an average return of 1.34 percent.

Resource shares led the way up as the price of oil rose to a more than two-year high above $91 a barrel. Chevron Corp rose 0.9 percent to $90.68.

Retail stocks got a boost as Bed Bath & Beyond Inc rose 5.1 percent to $50.10 after topping profit estimates and forecasting a strong holiday season.

Fabric and crafts retailer Jo-Ann Stores Inc surged 31.9 percent to $60.19 after it agreed to a buyout by private equity firm Leonard Green & Partners for $61 per share.

The Morgan Stanley Retail index <.MVR> gained 0.5 percent.

Top U.S. memory chip maker Micron Technology Inc weighed on the Nasdaq. Its shares tumbled 4.1 percent to $7.94 after it forecast lower pricing for NAND chips, which are used in smartphones and tablet computers.

About 4.56 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, well below last year's estimated daily average of 9.65 billion.

Declining stocks slightly outnumbered advancing ones on the NYSE by 1,529 to 1,422 , while on the Nasdaq, decliners beat advancers 1,478 to 1,173.

(Editing by Leslie Adler)