Traders pulled away from Apple and Nvidia, the same companies that have driven much of the S&P’s gains this year.