U.S. stocks closed nearly unchanged on Tuesday after earlier gains, with the S&P 500 and Dow hitting record highs. Investors are anticipating the first Federal Reserve rate cut in over four years. Economic data showed retail sales rose unexpectedly in August, indicating a stable economy through most of the third quarter.