Stocks retreated from near four-year peaks on Tuesday, while a batch of large-cap shares hit new highs, with the help of portfolio managers snapping up top performers near the end of the quarter.

With the first quarter ending on Friday, portfolio managers adjusted holdings by buying some of the best performers to dress up their portfolios. A total of 175 stocks on the New York Stock Exchange hit new 52-week highs on Tuesday, including Dow components Home Depot and International Business Machines , along with high-end retailers.

As long as the economy continues to improve, the market will continue to go up, and that's what's happened, said Bryant Evans, investment advisor and portfolio manager at Cozad Asset Management, in Champaign, Illinois.

The moves follow three months of big gains, putting the S&P 500 on track for its best quarter since the third quarter of 2009. It follows a similarly strong run in the fourth quarter of 2011, with gains for the past six months totaling 25 percent.

On Monday, the three major U.S. stock indexes rallied more than 1 percent after Federal Reserve Chairman Ben Bernanke signaled that supportive monetary policy will remain in place.

On Tuesday, Bernanke said in an ABC News interview, when asked about the potential for more quantitative easing, that the Fed isn't taking any options off the table.

The Dow Jones industrial average <.DJI> shed 43.90 points, or 0.33 percent, to 13,197.73 at Tuesday's close. The Standard & Poor's 500 Index <.SPX> dropped 3.99 points, or 0.28 percent, to 1,412.52. The Nasdaq Composite Index <.IXIC> dipped 2.22 points, or 0.07 percent, to 3,120.35.

Apple Inc hit another all-time high of $616.28, and closed with a market capitalization to $572.92 billion. The iPad and iPhone maker's stock then pulled back from that peak to end at $614.48, still up 1.2 percent for the day.

Among Dow components hitting 52-week highs, IBM climbed to $208.56 and then retreated slightly from that peak to end down 0.3 percent at $207.18.

Walt Disney Co climbed to a 52-week high of $44.50, only to slip to $44.15, off 0.5 percent. Home Depot reached a 52-week high at $50.34, then gave up some of that gain to end at $50.04, off 0.2 percent for the day.

Among sectors, the S&P technology and financial indexes led quarterly gains, with technology <.GSPT> last up 22.1 percent and financials <.GSPF> up 22 percent for the quarter so far.

Among top performing-stocks, Bank of America , the second-best performing S&P 500 stock for the quarter, is up 75 percent; Netflix , the third best, is up 74.6 percent.

Apple, in the 10th-best spot, is up 51.9 percent for the first quarter so far.

You'll see fund managers continue to rotate, and the technical bias is up right now, so that bodes well for quarterly window dressing, said Peter Cardillo, chief market economist at Rockwell Global Capital in New York.

Some investors believe further gains will be difficult to achieve since the rally has lasted for months without a major correction.

The market's sharp gains have followed improving U.S. economic data, as well as accommodative measures by central banks around the world.

In the latest economic report, the U.S. consumer confidence index dipped in March to 70.2, just a tad below the median forecast, while Americans ratcheted up inflation expectations to the highest level in 10 months, according to the Conference Board, a private industry group.

Volume was 6.07 billion shares on the NYSE, the Nasdaq and the Amex, compared with the daily average for the year so far of 6.83 billion.

Decliners outnumbered advancers on the NYSE by a ratio of more than 4 to 3, while on the Nasdaq, more than five stocks fell for every three that rose.

(Editing by Jan Paschal)