New York — Stocks ended a difficult 2018 on an up note amid hopes that the U.S. and China are making progress in resolving their differences over trade.

Investors took cheer from President Donald Trump saying in a tweet on Saturday that he'd had a "very good call" with Chinese President Xi Jinping. Mr. Trump added, "Deal is moving along very well. If made, it will be very comprehensive, covering all subjects, areas and points of dispute. Big progress being made!"

The official Xinhua News Agency cited a Chinese Foreign Ministry spokesman as saying that "China stands ready to work with the United States to move forward the China-U.S. ties which are underpinned by coordination, cooperation and stability."

Get Breaking News Delivered to Your Inbox

The Dow added 265 points, or 1.1 percent, to close at 23,327, while the S&P 500 and Nasdaq both rose 0.8 percent.

"Last week we really had such a volatile week, and a lot of that had to do with thin trading volumes, some computerized trading and investors just being exhausted from a very difficult fourth quarter," said Jeff Kravetz, regional investment strategist at U.S. Bank Wealth Management. "Today is the last day of the year and investors are starting to look into next year."

For the year, the S&P 500 fell 6.2 percent -- its first loss (including dividends) since the financial crisis in 2008. The Dow lost 5.6 percent in 2018.

Just had a long and very good call with President Xi of China. Deal is moving along very well. If made, it will be very comprehensive, covering all subjects, areas and points of dispute. Big progress being made! — Donald J. Trump (@realDonaldTrump) December 29, 2018

Critical deadline

Many analysts remain skeptical that the U.S. and China can set aside their differences on trade. American trade negotiators want Beijing to drop requirements that U.S. companies share technology and other proprietary data, as well as cut tariffs on American goods. Mr. Trump has also pushed for China to lower its trade surplus with the U.S.

The U.S. Trade Representative's office has set a March 2 deadline for stepped up tariffs on $200 billion in Chinese goods.

Goldman Sachs analysts said in a research note that they expect a further increase in U.S. tariffs on Chinese imports after the March 2 deadline, while noting that the sides could reach a more comprehensive trade deal by late 2019.

Trade worries aren't the only thing on investors' minds, with concerns growing that the American economy is gearing down. Macroeconomic Advisers, a closely watched forecaster on Wall Street, predicts growth of 1.5 percent in the first three months of 2019, down from 2.7 percent in the fourth quarter.

Factors weighing on economic activity include the ongoing partial U.S. government shutdown, while economists also say the fiscal stimulus from a 2017 tax cut is starting to fade.