Investors in U.S. stocks have plenty of reasons to feel sanguine about the market now, between major indexes trading at records, a wave of upbeat economic data, and signs of easing tensions on the trade front. Ironically, however, the degree to which investors are feeling good may be a reason to feel cautious.

Optimism over the economy and its prospects has been rising of late, a reflection of a rallying equity market, the lowest unemployment rate in almost two decades, and strong profit growth from American corporations.

Investor sentiment has gotten so euphoric, in fact, that some analysts are citing it as a potential risk. High confidence is sometimes seen as a contrary indicator, suggesting investors and consumers are euphoric, or at least complacent about the risks that could send equity prices lower.

A recent reading of consumer confidence came in at an 18-year high in August, hitting its loftiest level since October 2000, during the dot-com era.

Torsten Sløk, chief international economist at Deutsche Bank Securities, said confidence was “at levels normally indicating a recession is imminent.”

Courtesy Deutsche Bank Securities

According to the latest survey of investor sentiment by the American Association of Individual Investors, 43.5% of those polled describe themselves as bullish on the market, meaning they expect prices will be higher in six months. That’s a jump of 5 percentage points from the previous week, and it takes the ratio above its long-term average of 38.5%, as well as to its highest level since mid-June.

The number of investors describing themselves as bearish dropped by 2.7 percentage points to 24.4%.

Courtesy American Association of Individual Investors

Willie Delwiche, an investment strategist at Robert W. Baird & Co., cited the rise in investor bullish as an example of “bad news.” In a tweet, he wrote that optimism was “getting excessive.”

Thus far this year, the Dow Jones Industrial Average DJIA, +1.33% is up 5.1% while the S&P 500 SPX, +1.59% is up 8.5% and the Nasdaq Composite Index COMP, +2.26% has gained 17.2%. Both the S&P and the Nasdaq have recently hit record levels. The Dow is about 2.4% away from its own record, but it recent broke out of its longest stint in correction territory in almost 60 years.

Don’t miss:It’s ‘dangerous’ for bears to ignore the recent breakout in stocks, analyst says

President Donald Trump touted the rally in a tweet on Thursday, writing that “more good news is coming.” It wasn’t clear what he was referring to.