The S&P closed at record highs on Tuesday after hitting the 2,900 mark for a few moments during the trading session, buoyed by consumer optimism after the U.S. and Mexico formed a new trade deal.