Thereâs both good news and bad news for those who watch how U.S. stock-market investors are feeling about the current state of the equity market.

The good news is that optimism has dropped of late, a trend that is often taken as a positive contrary indicator as it prevents the kind of euphoria that can lead to steeper market declines in the event that the economy doesnât live up to lofty expectations. The bad news is that the waning investor and business sentiment has come on uncertainty over global trade policy, an issue that appears far from settled, seems to escalate by the day, and which could pose major a major threat to global growth at a time when fewer analysts are expecting conditions to improve over the coming year.

While trade issues have been in the headlines for months â a factor that has kept major stock-market indexes like the Dow Jones Industrial Average

DJIA, +0.54%

Â and the S&P 500

SPX, +0.93%

Â trading in a narrow range â recent developments have underlined the issueâs potential impact on markets. Several analysts have said that they have only recently begun to fret over the likelihood of a trade war, as well as the severity it could have on stocks.

Perhaps in a representative view, an analyst from Morgan Stanley Wealth Management recently wrote that âWe no longer believe that the implications of Washingtonâs trade talk are benign.â

Read: Stocks may still be underestimating the risk of a blowup in trade tensions

In recent trade developments, U.S. and China slapped levies on $34 billion of each otherâs exports, the first tangible shots in a trade battle with no end in sight. President Donald Trump said the U.S. could soon impose tariffs on more than $500 billion in Chinese imports, about the amount of total goods the U.S. imported from China last year.

The latest minutes from the Federal Reserve said that negative risks from U.S. trade policy âhad intensifiedâ of late, and that they could have negative effects on investment spending. Separately, while a read on manufacturing rose in July, businesses cited a negative impact from tariffs.

The issue has pushed investors to trim their exposure to equities; stock-based funds recently saw their second-largest weekly outflows ever, while exchange-traded funds had their third month of negative flows thus far in 2018 in June.

Peter Donisanu, an investment strategy analyst at the Wells Fargo Investment Institute, wrote, âWe believe that the risks related to a trade war involving the U.S. and China have notably increased over the past couple of weeks. While we expect cooler heads to prevail, a prolonged trade spat could affect our current market views and targets.â

The Wells Fargo Investment Institute said there was an 80% chance of âprolonged negotiations,â which would ultimately result in a favorable outcome for the market and the economy. It sees 10% odds for both a quick resolution, the âmost favorable outcome,â and another 10% chance of a rapid escalation in protectionist policies, which it deemed the most unfavorable outcome.

A 90% chance of prolonged negotiations or worse suggests that investors should expect heavy volatility over the near term, and that prospect seems to be showing up in sentiment figures.

Read: Investors look to the second half of 2018 expecting growthâamid rising uncertainties

Separately, a read on institutional-investor confidence has come down sharply this year, according to the Wells Fargo Investment Institute, a change it attributed in part to the trade issue.

Courtesy Wells Fargo Investment Institute

âLike most investors, we were assuming Trumpâs trade war was mostly ânoiseâ. We thought the likeliest outcome was a series of skirmishes, full of inconsequential measures and symbolic victories, which wouldnât ultimately undermine the macroeconomic outlook,â wrote Dario Perkins, managing director of global macro at TS Lombard.

âNow, as trade tensions escalate â perhaps even to the brink of a full scale trade war â the risks to markets are obviously increasing,â he said.

Other data reveals an overall mood shift. According to the AAII Investor Sentiment survey, the percentage of investors who describe themselves as bullish, meaning they expect stocks to be higher in six months, fell to a three-month low in the latest week. Only 27.9% of those polled are optimistic, well below the 38.5% historical average, and at a level that AAII described as âunusually low,â meaning it is one standard deviation below the long-term average.

The ratio of bearish investors stands at 39.3%, notably above the long-term average of 30.5%, but down 1.5 percentage points from the previous week, when it was at an unusually high level. Nearly 33% of investors describe themselves as neutral on the market; this reading has been above the historical average of 31% for 20 straight weeks, a sign of how mixed investors are about Wall Streetâs prospects over the rest of 2018.

Despite the falling investor confidence, a read on optimism from small businesses â a segment of the economy with little exposure to trade issues â is at its second-highest level of the past 45 years, while a reading of consumer confidence is near an 18-year high.

In another sign that investors may not be particularly afraid, the Cboe Volatility Index

VIX, -10.09%

Â is at 13.52, well below its long-term average between 19 and 20. While the VIX is up 22.5% thus far this year â following an atypically quiet year in 2017 â it has dropped 16% over the past week.