S&P, Nasdaq end at record peaks on strong earnings