US stocks ended the day Monday at new record highs — lifted by rising optimism over a US-China trade deal and an improving domestic economy.

The Dow Jones Industrial Average rose 115 points, or 0.4 percent, to 27,463, setting its first closing record since July. The S&P 500 added 0.4 percent and the Nasdaq Composite advanced 0.6 percent — both at new highs.

US officials on Friday indicated that a trade deal with China could be signed this month, with risk sentiment also boosted by Commerce Secretary Wilbur Ross saying on Sunday that licenses for US companies to sell components to Huawei Technologies Co Ltd would come “very shortly.”

In May, Huawei, the world’s largest telecoms equipment provider, was put under a US blacklist citing national security concerns.

The technology sector gained, as trade-sensitive chip stocks rallied and also helped the Philadelphia Semiconductor index to a record high.

Optimism about progress with China after Friday’s market highs is “making it easier for investors to continue buying and climbing a wall of worry,” said Michael James, managing director of equity trading at Wedbush Securities in Los Angeles.

Energy shares jumped along with gains in oil prices.

The third-quarter earnings season has been fairly upbeat, with the majority of S&P 500 companies beating profit expectations so far, according to Refinitiv data.

Last week’s interest rate cut by the Federal Reserve, hopes of a trade deal and a better-than-feared October jobs growth report have been the main catalysts of the recent rally.

Financial stocks gained 0.90 percent, helped by a 1.2 percent rise in shares of Berkshire Hathaway Inc after it topped estimates for quarterly operating profit.

Limiting the day’s gains was a roughly 3 percent drop in shares of McDonald’s Corp, which dismissed Chief Executive Steve Easterbrook over a consensual relationship with an employee.

Under Armour Inc fell more than 19 percent as the sportswear maker lowered its full-year revenue forecast for a second straight time this year, a day after it confirmed a federal probe related to its accounting practices.