The S&P 500 notched its ninth straight days of gains this week, its longest winning streak since November 2004.