Should an investor go for bonds or stocks in the near to medium term? Both markets have been volatile recently, which could make it a difficult choice for traders. Stocks rallied after the U.S. Federal Reserve’s decision to keep interest rates steady, but Fed Chair Jerome Powell stressed that the central bank hasn’t begun considering a rate cut, and won’t until inflation is under control. On the fixed income side, it’s been a bad bond bear market this year. Yields had been climbing, but the 10-year Treasury shot up in recent weeks, rising to the 5% mark in a 16-year high, before inching back down. It was last around 4.718%. “On one side of the field are equities. On the whole, they generally offer the strategy of growth over time and the possibility of a decent dividend,” said Scott Wren, senior global market strategist at Wells Fargo Investment Institute. “On the other side of the field … are bonds.” “Investors are now asking themselves if they would rather lock in a rate close to 5% on a 10-year Treasury note or take on what has been historically the higher risk of equities, which, at least at the current index level, offer a far smaller dividend yield,” he wrote in a Nov. 1 note. Going by recent commentary, some on Wall Street prefer bonds as an asset class. Here’s what the pros are saying. UBS Both stocks and bonds retreated in October in the wake of war in the Middle East and concerns about rates, UBS said. “Rising yields were a major drag on equity markets, generally reducing the relative appeal of stocks,” the bank said in a November 1 note. UBS said although there’s a “solid foundation” for diversified portfolios over the next six to 12 months — and its base case is for good returns on both bonds, stocks, cash and alternatives — bonds look better. The outlook for corporate earnings is looking up, but bonds look “even more promising,” the bank said. “Market expectations that Fed rates will stay high for longer have gone too far, in our view. As the mood changes, we expect yields—which are at their most attractive level since the global financial crisis—to move lower,” it said. With inflation moderating, UBS says it sees the greatest near-term upside in fixed income — especially quality bonds. Wells Fargo Investment Institute In an Oct. 30 note, Wells Fargo said it expects a recession and the average stock will likely continue to struggle. It predicts that markets are seeing the end of the Fed tightening cycle, and expects the central bank to cut rates in the event of a recession. “In both instances, we expect that bonds on the short and long ends of the curve should eventually see some price appreciation.” However, Wells Fargo’s Wren said stocks are still preferable in the long term. “The potential to grow earnings and dividends over time is a key reason why equities have posted higher long-term total returns than bonds,” he wrote. Schroders Bond bears could push yields on the 10-year Treasury over 5% in the short term, Schroders said in an Oct. 30 note. But it still believes in bonds over stocks — and even cash. “Still, we believe owning bonds over the medium and long term will reward investors well, both in an absolute sense and relative to other asset classes, including cash and equities,” said Neil Sutherland, U.S. multi-sector fixed income portfolio manager at the asset management firm. He urged investors to stay the course despite the bond market rout, which has the potential to diminish trillions of dollars in sovereign and corporate bond investments. Investing is a “long game,” he said, with bonds remaining a “good bet” for the medium and long term. “While inflation may be more elevated than the previous decade, yields — both real and nominal — on higher quality bonds now stand at their highest levels in 15 years and screen cheaply not just in an absolute sense, but also relative to other asset classes, particularly equities,” Sutherland wrote. How to invest UBS favors the higher-quality segments of fixed income, preferring high-grade government and investment-grade bonds. It’s neutral on high yield and emerging market credit. Given that 10-year Treasury yields could still move higher in the near term — well beyond 5% — Wells Fargo said, it continues to favor a barbell strategy within bond portfolios, extending duration and going for high-quality investment-grade fixed income. Barbell is a strategy that strikes a balance between reward and risk by investing in the high-and low-risk assets. Overall, Wells Fargo said, it’s most favorable on U.S. long-term taxable fixed income, and its short-term counterpart, and favorable on U.S. taxable investment-grade fixed income. It’s least favorable on U.S. intermediate-term taxable fixed income and high yield taxable fixed income. — CNBC’s Michael Bloom contributed to this report.