In addition, he said, “there’s going to be tremendous political pressure to keep the party going,” especially since Mr. Trump has so often cited the bull market as evidence of the success of his presidency.

So what should investors do?

It’s probably no surprise that Burton G. Malkiel, the renowned emeritus professor of economics at Princeton and author of the 1973 classic “A Random Walk Down Wall Street: The Time-Tested Strategy for Successful Investing,” recommends that investors “stay the course.”

“If the sharp rise in the stock market in 2017 has unbalanced your portfolio with a higher proportion of equities than is consistent with your risk tolerance, then you could do some rebalancing by trimming the equities down to the proportion at which you are comfortable,” Mr. Malkiel said. “But do not try to time the market. Nobody can consistently time the market, and those who try it usually fail.”

Although Mr. Malkiel is a longtime champion of passive, low-cost index investing, a strategy that has worked well since the financial crisis, last year he endorsed an “advanced indexing” approach at the automated investment manager Wealthfront, where he is chief investment adviser. Wealthfront aims to outperform strictly passive investing, and its taxable portfolio returned 20.56 percent last year, which indeed beat its benchmark.

Mr. Dodson is an active manager who focuses on stock selection. “I’ve never had a good record at market timing,” he said. “I look for stocks that are undervalued, but I’m having terrible trouble finding anything that’s reasonably priced.”

Technology stocks in general “are way overvalued,” he said. He has cut back on his fund’s large positions in Micron Technologies, Apple and Applied Materials after they notched big gains. With benefit of hindsight, he wouldn’t have sold them, “but someone once asked Bernard Baruch how he became so rich,” Mr. Dodson said. “‘I made my money by selling too soon,’” the famed financier replied.