Around the globe, investors are feeling both excited and cautious about stocks, as they bet Wall Street’s record-long bull market has more gas in the tank but also guard against an international picture that looks shaky.

According to the latest monthly survey of fund managers by Bank of America Merrill Lynch, released Tuesday, investors are increasingly optimistic about U.S. stocks. There is a net allocation of 21% overweight to the region’s equity market, the highest such level since January 2015, and it was named as the most favored equity region globally for a second straight month. The allocation to global equities fell 11 percentage points to a net overweight of 22%, slightly below the long-term average.

Courtesy Bank of America-Merrill Lynch

In large part, the optimism about U.S. stocks is related to the outlook for corporate profits. Earnings growth has been extremely strong — thanks in large part to the tax-cut bill passed in late 2017, although the impact this will have on growth will fade in the coming quarters.

According to the survey, a net 69% of those polled said that U.S. is the most favorable region when it comes to earnings expectations, a record level in the 17-year history of the survey. Currently, the divergence between U.S. and emerging-market earnings expectations is at its widest since January 2014.

Courtesy Bank of America-Merrill Lynch

The picture for corporate profits, along with improving economic data, has helped U.S. stocks shrug off all manner of headwinds, resulting in a low-volatility market that has generally been trending higher.

The S&P 500 SPX, +0.35% is up 8.5% in 2018, and it currently sits 0.5% below its record close from August. The Dow DJIA, +0.29% is up 5.7% in 2018, and it is less than 2% below its own all-time high. The Nasdaq Composite Index COMP, +0.50% has risen 15.3% this year. The Nasdaq has been supported by big gains in large-capitalization technology stocks, although this has also amplified volatility in the tech-heavy index, which is down 2.1% from its record.

The view that U.S. stocks are supported by strong and improving fundamentals has helped investors shrug off the prospect of a potential trade war with major trading partners, despite President Donald Trump issuing or threatening tariffs on billions of dollars worth of goods world-wide.

Read:Trump to impose tariffs on another $200 billion of Chinese goods

Also see:Here’s the hit stocks around the world have taken from trade-war fears so far

While a trade war is still seen as the biggest “tail risk” facing markets, the threat has been fading. While 43% of those polled by the survey named it as the biggest risk, that’s down from the roughly 55% that named it the biggest risk in the August survey.

See:Trade war’s ‘nuclear option’ could be bad for Apple, Amazon: strategist

Among other potential risks, 18% of those polled said that a slowdown in China’s economy was the biggest threat, up from about 15% in the previous survey, while “quantitative tightening” — or less accommodative central-bank policy — was the third-biggest threat. Roughly 15% of those polled cited that as the biggest risk, roughly the same number who did in August.

Related:Don’t expect big stock gains for several years, Morgan Stanley warns

The survey did indicate some caution on the part of fund managers, particularly with respect to overseas markets. Emerging-market economies have been struggling throughout 2018, hurt by a stronger U.S. dollar and trade fears, in addition to a variety of country-specific issues. In a reflection of such issues, optimism about global growth came in at a six-year low. The survey found 24% of investors expect global growth to decelerate over the next 12 months, the worst outlook since December 2011.

Don’t miss:The new fear for stock investors is an emerging-market meltdown

Investors polled in the survey raised their average cash levels to an 18-month high of 5.1% from 5% a month earlier, well above the 10-year average of a 4.5% allocation.

However, that cautious allocation could be an optimistic contrarian signal. BAML analysts said an average cash balance above 4.5% generates a contrarian buy signal for stocks; currently, cash has been generating such a signal for seven months.

While the view toward stocks was broadly optimistic, investors did express some concern about the so-called FAANG+BAT trade. This refers to a group of five major U.S. internet and technology stocks — Facebook FB, +0.11% , Amazon AMZN, +0.79% , Apple AAPL, +1.23% , Netflix NFLX, +0.55% , and Google-parent Alphabet GOOGL, +1.06% GOOG, +1.12% — and a trio of Chinese firms: Baidu BIDU, +0.06% , Alibaba BABA, -1.35% , and Tencent TCEHY, +0.61% . All of these have been among the biggest gainers of recent years, and their size has helped to lift the overall markets.

The size of their rally, however, has led to concerns that they are overvalued.

According to the survey, 36% of those polled said that “long FAANG+BAT” trade was the most crowded in the market, though this was down from the nearly 55% that named this the most crowded in the previous survey. Among other trades seen as crowded was “short emerging-market equity,” which was named by 16% of those polled. To short something is to bet on its decline; the survey response could be a sign that investors think the selloff in emerging-market stocks has been overdone.