Stocks moved sharply higher over the course of the trading day on Thursday after ending the previous session roughly flat. The gains on the day lifted the S&P 500 to a new record closing high, while the Dow reached its best levels since early March.