All 10 sectors of the Standard and Poor's 500 were higher. Investors were also keeping an eye on Greece a day after the country struck a preliminary deal with its creditors and a falling Chinese stock market.