People with umbrellas pass by bull and bear outside Frankfurt's stock exchange during heavy rain in Frankfurt, Germany.

Portfolio managers who spent much of the summer worried about an impending recession are now instead afraid of losing out as the stock market heads for record highs, according to a widely followed survey conducted by Bank of America Merrill Lynch.

The investment bank's latest monthly survey of global fund managers found that cash levels posted their largest decline since President Donald Trump's 2016 election to 4.2% from 5% as investors rushed to take on risk. Cash on hand is now at its lowest level since June 2013.

Michael Hartnett, chief investment strategist at Bank of America, also said that manager global growth optimism surged by the most in 20 years to 18-month highs, a sign investors expect better manufacturing and profit numbers worldwide.

"The bulls are back…global recession concerns vanish and 'Fear of Missing Out' prompts wave of optimism and jump in exposure to equities & cyclicals," Hartnett wrote in a note to clients. "We say…easy part of rally over, tougher part of rally beginning…but rally it can as no 'excess greed,' there is 'excess liquidity' (and trade/fiscal easing), and corporate earnings set to accelerate."

"FOMO" or fear of missing out, is a commonly used term among traders to describe herding behavior by investors when the market starts to gain rapidly.

Investors still said "trade war" is the No. 1 trail risk to a rebound in equities, but bulls noted that a "trade truce" might be enough to keep stocks grinding higher to records, the strategist said.

Both the Dow Jones Industrial Average and the S&P 500 have posted records within the last week as warmer trade relations and renewed hopes for a trade cease-fire between the U.S. and China goaded investors back into riskier assets.

The Dow — up more than 3% over the last month — inched higher to a record close on Monday at 27,691.49. Trade-exposed names like Apple, Intel and Dow have all led the charge higher.

More pessimistic investors, however, forecast no more Federal Reserve rate cuts before the 2020 election. That could unwind stubborn long positions in U.S. tech and growth stocks, Hartnett wrote.

The Bank of America survey, conducted Nov. 1 through Nov. 7, included 230 panelists with $574 billion in assets under management. The monthly survey is the most-watched poll of its kind among Wall Street investors and traders.

Hartnett added, however, that the marked drop in cash holdings isn't necessarily a green light for clients who've held off on rejoining the stock market. Rapidly falling cash holdings are often a contrarian sell signal. It often pays off to invest in stocks when the crowd is selling stocks and raising cash, he figures.