Stocks closed higher on Thursday as a rebound from sharp losses last month continued after comments from President Donald Trump indicated potential progress in U.S.-China trade relations.

The Dow Jones Industrial Average gained 264.98 points to 25,380.74 as DowDuPont outperformed, bringing its three-day gains to more than 900 points. The climbed 1.1 percent to 2,740.37, with the materials leading. The Nasdaq Composite advanced 1.8 percent to 7,434.06 ahead of Apple's quarterly earnings report.

Trump said in a tweet Thursday that he had a "long and very good conversation" with Chinese President Xi Jinping on trade. He also said meetings between the two at the upcoming G-20 summit are being scheduled.

Tweet

"It is positive that the two leaders are speaking," said Jon Adams, investment strategist at BMO Global Asset Management. "We think shorter term we'll have these tensions as a headwind for the market, but in the intermediate term we think a deal will get done."

Thursday's moves come after investors capped off a volatile October with strong gains. The S&P 500 posted back-to-back gains of more than 1 percent to end last month.

But "as pleasant as the last two sessions have been to experience they do not by themselves indicate that the worst is over," said Michael Shaoul, chairman and CEO of Marketfield Asset Management. "All we can say so far is that Monday's accelerated drop lower found good support for the S&P 500 just above 2,600, and any subsequent retest should at least struggle to penetrate this level."