"Right now, it seems like every pullback in the market is seen as a buying opportunity," Sorensen said. "People may say they're getting nervous, but where else are you going to put money at this point? Into Europe with their political issues? Into Treasuries paying less than 1.7 percent?"
The S&P 500 edged up 3.96 points to close at 1,597.57. The slight gain of 0.3 percent pushed the index to an all-time high for the second straight day.
A report of another record high in European unemployment helped drive money into U.S. government debt, briefly sending the yield on the benchmark 10-year Treasury note to the lowest level of the year, 1.65 percent.
IBM said it would add a dime to its quarterly dividend and buy back up to $5 billion more of its stock. This month, the company surprised investors when it reported a drop in quarterly earnings and sales. IBM's stock rose $3.39 to $202.54.
The tech giant's 1.7 percent gain pushed the Dow Jones industrial average up. The Dow fell as much as 84 points in morning trading but ended with a gain of 21.05 points, at 14,839.80. That's an increase of 0.1 percent.
The S&P's six-month climb is the longest stretch of gains since a seven-month run that started in March 2009, when the market hit a financial-crisis low.
In other trading, the Nasdaq composite index rose 21.77 points to 3,328.79, up 0.7 percent. The dollar fell against the yen and the euro, and the price of crude oil fell $1 to $93.46 a barrel. Gold edged up $4.70 to $1,472.10 an ounce.
The yield on the 10-year Treasury note traded at 1.67 percent late Tuesday, the same as the day before. In response to slower economic growth, bond traders from around the world have been buying Treasuries this month, driving yields down. The 10-year yield started April around 1.85 percent.