The Nasdaq composite advanced 0.3 percent to 6,624. The three indexes reached record intraday and closing highs.

The finished 0.2 percent higher at 2,557.64, with telecommunications and financials leading advancers. Losses in real estate and health care capped gains on the S&P 500.

Shares of Apple rose 1.8 percent after analysts at KeyBanc Capital Markets upgraded the stock to overweight from sector weight, noting the company will report better-than-expected earnings in 2018.

The Dow Jones industrial average gained 85.24 points to close at 22,956.96. JPMorgan Chase shares rose 2 percent to lead the 30-stock index.

U.S. stocks hit record highs on Monday as Wall Street looked ahead to the release of 's quarterly results.

Netflix reported third-quarter earnings and revenues that beat expectations. Netflix's stock hit a record high last week after analysts at Goldman Sachs predicted the company will post subscriber gains above expectations . Netflix shares closed 1.6 percent higher; they also hit a record high earlier in the session.

Traders work on the floor of the New York Stock Exchange (NYSE) on November 22, 2016 in New York City.

Earnings season kicked off last week with JPMorgan Chase, Citigroup and Bank of America releasing their results. Goldman Sachs, Morgan Stanley, Verizon and Honeywell are among the companies set to report this week.

"This week is important because you've got companies from almost each sector reporting, so you're going to get a good picture" of Corporate America's health, said Quincy Krosby, chief market strategist at Prudential Financial.

Equities posted slight gains last week, reaching new records and building on their sharp year-to-date gains. The three major indexes are up at least 17 percent in 2017.

"The support for the market is centered on improving economic conditions worldwide and on growing expectations for tax relief," said Bruce Bittles, chief investment strategist at Baird, in a note to clients.

"From a flow of funds perspective, tax reform is expected to allow for the return of overseas profits estimated at being more than $2 trillion. The money from overseas could provide capital for stock buybacks," Bittles said.

Investors' hopes of corporate tax reform have increased recently after the House passed a $4.1 trillion budget earlier this month. The Senate is expected to vote on the budget this week.

President Donald Trump touted the U.S. stock market on Monday, tweeting: "Since Election Day on November 8, the Stock Market is up more than 25%, unemployment is at a 17 year low & companies are coming back to U.S."

He also said in a separate tweet: "The U.S. has gained more than 5.2 trillion dollars in Stock Market Value since Election Day! Also, record business enthusiasm."

Tweet: Since Election Day on November 8, the Stock Market is up more than 25%, unemployment is at a 17 year low & companies are coming back to U.S.

Tweet: The U.S. has gained more than 5.2 trillion dollars in Stock Market Value since Election Day! Also, record business enthusiasm.

The president also talked about drug prices on Monday. Trump said from the White House that prescription drug prices are "out of control."

"If you look at the exact, same drug by the exact same company made in the exact same box and sold someplace else, sometimes it's a fraction of what we pay in this country," Trump said.

Trump's remarks sent health-care stocks lower, with the Health Care Select Sector SPDR exchange-traded fund (XLV) sliding 0.5 percent.

"We've seen this movie before," said Mike Bailey, director of research at FBB Capital Partners, noting that Trump has made similar comments in the past. "I would expect this to be more of a short-term knee-jerk reaction than a material, long-term change in the sector."