Stocks rose on Tuesday as solid earnings and a new flurry of merger action laid the foundation for a steady upward trend in the equities market that investors believe will continue.

U.S. stock indexes hit new highs after topping key technical resistance levels. The S&P 500 has rallied 6.1 percent to two-year highs this month and was up around 22.5 percent from closing lows this year.

Analysts said equity markets were also lifted as fund managers reallocated cash to equities from fixed income and reduced cash positions.

The psychology has changed. With interest rates coming up, the bond market is telling you, you don't want to be in bonds if the economy may be improving next year. So a lot of that money is starting to move into the stock market, said Paul Mendelsohn, chief investment strategist at Windham Financial Services in Charlotte, Vermont.

This is your Santa Claus rally. Everybody is coming in, you are clicking on all eight cylinders here.

The Dow Jones industrial average <.DJI> gained 40.31 points, or 0.35 percent, to 11,518.44. The Standard & Poor's 500 Index <.SPX> rose 5.26 points, or 0.42 percent, to 1,252.34. The Nasdaq Composite Index <.IXIC> advanced 12.65 points, or 0.48 percent, to 2,662.21.

Adobe Systems Inc jumped 4.6 percent to $30.53 after an upbeat forecast in contrast with a pessimistic outlook three months ago. For details, see [ID:nN20202319]

U.S. coal miner Massey Energy Co rose 1.3 percent to $52.49 after the Wall Street Journal reported that rival Alpha Natural Resources Inc offered to buy it. Alpha Natural climbed nearly 3 percent to $55.15.

Further supporting rising stock indexes were recent technical signals indicating the march upward could continue.

The S&P 500, which has gained in each of the last three weeks, broke through the 61.8 percent Fibonacci retracement of the 2007-2009 bear market slide earlier this month.

Technicians say the next stop is the 76.4 percent retracement at 1,362.

John Brady, senior vice president at MF Global in Chicago, expects the market to move either slowly sideways or higher as S&P 500 works off an overbought condition shown in the seven-day and nine-day Relative Strength Index (RSI).

It's a grind trade higher on not a whole lot of volume, he said. A trade between 1,250 and 1,230 (in the S&P 500) seems really well contained, and any profit-taking will probably be modest.

The RSI provides a measure of higher closes to lower closes over a given trading period and is closely watched by traders.

In other individual movers, Martek Biosciences Corp surged 35 percent to $31.54 after Dutch group DSM , the world's largest vitamins maker, agreed to buy the maker of U.S. baby food ingredients.

Jabil Circuit Inc , the electronics manufacturer, advanced 10 percent to $19.38 a day after it reported better-than-expected quarterly profit and forecast a robust second quarter.

(Editing by Padraic Cassidy and Jeffrey Benkoe)