(Reuters) - The benchmark S&P 500 stock index eked out a slim gain on Tuesday as President Donald Trump said the United States is close to signing an initial trade deal with China but offered no new details about negotiations.

The S&P 500 and Nasdaq hit all-time highs during trading but stocks ended off session highs after a highly anticipated midday speech from Trump, with investors concerned ahead of time about any comments that would worsen the tariff dispute that has convulsed markets for more than a year.

Trump said U.S. and Chinese negotiators were “close” to a “phase one” trade deal, but largely repeated well-worn rhetoric about China’s “cheating” on trade in remarks at The Economic Club of New York.

“People were hoping to get a little bit more clarity on the trade front and that doesn’t seem to have been the case,” said Chuck Carlson, chief executive officer at Horizon Investment Services in Hammond, Indiana.

Investors have pointed to U.S.-China trade tensions as the main market uncertainty as stocks have climbed to record levels, fueled by rate cuts by the Federal Reserve, third-quarter earnings coming in above low expectations, and signs the economy may be bottoming.

Still, Carlson said, “the market to some extent is starting to try not to be too reactive one way or the other to what the president is saying about trade.”

On Tuesday, the Dow Jones Industrial Average .DJI remained unchanged at 27,691.49, the S&P 500 .SPX gained 4.83 points, or 0.16%, to 3,091.84 and the Nasdaq Composite .IXIC added 21.81 points, or 0.26%, to 8,486.09.

FILE PHOTO: Traders work on the floor at the New York Stock Exchange (NYSE) in New York, U.S., November 6, 2019. REUTERS/Brendan McDermid

Most S&P 500 sectors finished in positive territory, with healthcare .SPXHC the top gainer. Real estate .SPLRCR lagged the most, falling 0.8%.

Among stocks, Walt Disney Co DIS.N rose 1.3% as the company said demand for its much-anticipated streaming service, Disney+, was well above its expectations in a launch.

Shares of Netflix Inc NFLX.O fell 0.7%.

Rockwell Automation Inc ROK.N shares jumped 10.5% after the U.S. factory equipment maker easily beat quarterly results and forecast 2020 earnings above estimates.

CBS Corp CBS.N shares dropped 3.6% after the media company missed quarterly revenue estimates. Shares of Viacom Inc VIAB.O, which is merging with CBS, slid 3.8%.

With third-quarter earnings season drawing to a close, about three-quarters of S&P 500 companies have topped profit estimates, but overall they are expected to have posted a 0.5% drop in earnings, according to Refinitiv.

Earnings from big firms including Walmart Inc WMT.N, Nvidia Corp NVDA.O and Cisco Systems Inc CSCO.O, as well as a fresh set of economic data, are due this week.

Declining issues outnumbered advancing ones on the NYSE by a 1.04-to-1 ratio; on Nasdaq, the ratio was roughly even.

The S&P 500 posted 42 new 52-week highs and two new lows; the Nasdaq Composite recorded 109 new highs and 104 new lows.

About 6.6 billion shares changed hands in U.S. exchanges, just below the 6.8 billion-share daily average over the last 20 sessions.