S&P 500 stuck in range since June as Fed, earnings test year-end