The S&P 500 and Nasdaq closed at records as earnings foreshadowed the possibility of a profitable peace.