S&P 500, Nasdaq close week at new all-time highs