The U.S. central bank is largely expected to lower interest rates by 25 basis points. That would be the third time this year the Fed cuts rates. However, investors will also look for clues about the Fed's policy decisions in the future.

The broad index closed 0.1% lower at 3,036.89, snapping a four-day winning streak. Earlier in the session, however, it gained as much as 0.3% to hit an all-time high of 3,047.87. The Dow Jones Industrial Average closed 19.30 points lower, or 0.1% at 27,071.42.

The S&P 500 touched a fresh record high on Tuesday before closing just below the flatline as investors looked ahead to key Federal Reserve meeting.

A trader works on the floor of the New York Stock Exchange October 18, 2006 in New York City as the Dow Jones Industrial Average passed the 12,000 mark today for the first time in its 110-year history.

"We expect the Federal Reserve to cut rates this week," said Mark Haefele, global chief investment officer at UBS Global Wealth Management. "But while we expect easier policy to support the economy, we don't see it driving significant upside in equities. Lower rates are unlikely to spur a sharp rebound in investment, for example, since trade uncertainty has been the main reason for businesses to put off spending."

Tuesday's moves come a day after the S&P 500 posted its first record high since July 26, breaking above 3,027.98. Better-than-expected earnings, along with improvements on the U.S.-China trade front, pushed the broad index above its previous record set in July.

"We broke out of this range we'd been in for several months between 2,800 and 3,000 on the S&P 500," said Paul Brigandi, head of trading at Direxion. "The market now is in a good place. Rates are low. We have another FOMC meeting tomorrow and we're probably going to get another rate cut."

The S&P 500's record high extended the second-largest ever bull market to 3,885 days, according to data from Bespoke Investment Group.

Data from FactSet shows 78% of the S&P 500 companies that have reported thus far beat analyst expectations. Investors are also increasing bets that at least a partial trade deal between China and the U.S. will be signed next month.

"Although a lot of ill will has been bred and there is more work to do, [President Donald] Trump has referred to Phase 1 of this deal as a 'love fest,'" said Bruce Bittles, chief investment strategist at Baird. "Should some form of agreement transpire, it would likely lessen business uncertainty, restore capital spending and be a positive for the stock market."

To be sure, expectations of a trade-war resolution took a hit on Tuesday after Reuters reported the phase one trade deal may not be signed at a November summit in Chile. The report, however, cited a U.S. administration official saying if a deal is not signed then, it just means more time is needed to move forward.

The major indexes fell rapidly on the news but quickly stabilized. Risk-off assets such as the 10-year Treasury yield and gold futures barely budged on the report.

Sentiment was also kept in check Tuesday by a 2.2% slide in shares of Google-parent Alphabet, which fell after the company posted earnings that missed analyst expectations. Alphabet reported a profit of $10.12 per share. Analysts polled by Refinitiv expected earnings per share of $12.42.

Guggenheim analyst Michael Morris pointed to rising costs as a source of weakness for the search-engine giant. "Higher personnel spending, particularly for R&D and marketing, was the primary cost driver and we expect investment to continue into 4Q," he said in a in a note.

"While we maintain confidence in Alphabet's leadership positions (talent, technology and financial resources), we expect bearish concerns toward spending to weigh on near-term sentiment," Morris added.

Alphabet's losses led the Nasdaq Composite down by 0.6% to end the day at 8,276.85.

In other corporate news, Merck's earnings beat expectations, boosted by immunotherapy drug Keytruda. Pfizer's profit also topped analyst estimates. Both stocks were up at least 2.5%.