The U.S. stock market has gone from near free-fall over Brexit to breaking out to all-time highs. All in the span of less than three weeks.

The swing has been stunning. The Dow is up an incredible 1,275 points from the post-Brexit lows and is trading at record levels. The S&P 500 too has hit record highs three-straight days and even the once-struggling Nasdaq is nearing uncharted territory.

The surprisingly strong July jobs report seems to have erased all memories of Brexit fears contaminating the global economy. Research firm Investors Intelligence said on Wednesday that bullish sentiment among investing newsletter writers has climbed above 50% for the first time since early 2015. And the percentage of investors calling for a 10% decline or more has dropped to the lowest level in two years.

It's definitely good news that investors have stopped freaking out. But such extreme levels of optimism can signal that rallies are overdone, and vice versa. Recall that sentiment got overly negative in February 2016, just before U.S. stocks bottomed at two-year lows and started a huge comeback.

Investors Intelligence warned on Wednesday that "the bulls have entered the danger-higher risk zone." It noted that sentiment is "near a negative shift" from a contrarian viewpoint.

Related: Stocks have never been higher

"We're at an extreme level. The market is certainly giddy again," said Peter Boockvar, chief market analyst at The Lindsey Group.

Boockvar said the sentiment indicators should "give people pause" because the recent gains have made "stocks more and more expensive -- and dangerous." However, he said timing exactly when the markets will take a much-needed breather is difficult, adding this is "not a line in the sand."

There are other signs of the turnaround in the market's mood. CNNMoney's Fear and Greed Index is flashing "extreme greed" and closed on Tuesday at the highest level in two years. Just a few weeks ago this gauge of sentiment was reflecting "fear."

Small-cap stocks are also on fire. The Russell 2000 skyrocketed 11% over the 10 trading days ended Tuesday, the first time that's happened since the end of 2011, according to Bespoke Investment Group. "It's almost like investors are viewing Brexit positively at this point," Bespoke wrote in a report.

Related: Still plenty of signs of skittishness on Wall Street

While some believe the market is due for a pause, Peter Kenny, an independent market strategist, thinks stocks have more room to run, despite the recent rally.

He pointed to four key drivers: Brexit didn't spark a global financial crisis, the U.S. added way more jobs in July than expected, the earnings recession could soon be ending and extremely low bond yields make stocks look less expensive.

"None of those factors are wishful thinking. They're all based on reality," said Kenny.