Stocks edged higher on Friday as rising energy shares overshadowed profit taking that followed the market's strong gains in March and April.
Earlier stocks fell but pared losses after stronger-than-expected data on consumer confidence and manufacturing in April.
The market's early losses came as investors chose to book some gains after stocks' strong run since the early March bear market low, The S&P 500 index recorded its biggest rise in nine years last month.
I think people are starting to feel they need to take profits on some on the gains they've had, said Angel Mata, managing director of listed trading at Stifel Nicolaus Capital Markets in Baltimore.
I wouldn't be surprised to see the psychology shifting from 'I don't want to miss the move' to 'I should be taking profits here.'
The Dow Jones industrial average <.DJI> added 7.41 points, or 0.09 percent, to 8,175.53. The Standard & Poor's 500 Index <.SPX> put on 1.48 points, or 0.17 percent, to 874.29. The Nasdaq Composite Index <.IXIC> was off 1.26 points, or 0.07 percent, to 1,716.04.
Consumer discretionary shares fell. McDonald's Corp
McDonald's was down 1.7 percent at $52.38, while the S&P index of consumer discretionary shares <.GSPD> fell 1.1 percent.
Data showed the U.S. factory sector shrank further in April, but at a slower pace, and consumers felt more confident about the economy last month than at any time since September.
Also, new orders received by factories declined last month.
The Standard & Poor's 500 Index closed out its best month in nine years on Thursday, gaining 9.4 percent for April on hopes the worst was over for the financial sector and recession-hit economy. The index is up nearly 29 percent from the bear market low of early March.
Shares of biotechnology companies weighed on the Nasdaq, with Celgene Corp
Of the 280 companies in the S&P 500 that have reported earnings to date, 65 percent topped analysts' estimates, according to data compiled by Thomson Reuters as of Thursday. However, many of the analysts' estimates had been reduced to reflect the current economic slump.
(Reporting by Leah Schnurr; additional reporting by Edward Krudy; Editing by Kenneth Barry)