The Standard & Poor's 500 gained 0.20%, or 2.72 points, to 1,347.05. The Dow Jones Industrial Average rallied 0.26%, by 33.07 points, to 12,878.20. The Nasdaq Composite Index grew by 0.07%, or 2.09 points, to 2,904.08.
"On the equities side, we've come a long way, and we are getting into overbought territory, so most of us are expecting a bit of a pullback or a period of consolidation," said Frank Lesh, a futures analyst and broker at FuturePath Trading LLC in Chicago.
"The depth of the pullback really depends on Greece and the European debt problems."