U.S. equities closed at all-time highs on Friday, as the major indexes posted their best week since the election.

The Dow Jones industrial average rose about 130 points heading into the close, with 3M and Apple contributing the most gains. The Nasdaq composite gained about 0.5 percent, as Apple advanced more than 1.5 percent.

"It's a great time; everyone's having fun. But people need to remember that bull markets don't end on pessimism; they end in euphoria. I'd advise people to not get too euphoric," said Sean O'Hara, director at Pacer Financial.

The S&P 500 gained 0.6 percent, with consumer staples and health care leading advancers.



"People are predisposed to think stocks are maybe going to pay less in taxes" and that we're getting better economic data in the future, said Kim Forrest, senior equity analyst at Fort Pitt Capital. "I think we're in the clear for a little while."

All major indexes have been hitting record highs since the election. In fact, the Dow has notched 14 record closes since then and gains in 20 of the past 24 sessions.

The Dow, S&P 500, and Nasdaq also did something they haven't done in more than five years: all three rose each day of this trading week. The last time all three rose every day during the same trading week was September 2011.



"I'm frankly surprised that we've kept breaking into new highs," said Randy Frederick, vice president of trading and derivatives at Charles Schwab. "The fundamentals aren't terrible, but the valuations have gotten really high. The economic data has been modest, but not great."

"If the market is really being driven by optimism, I can't see that changing until the new administration takes office," said Frederick.