It may seem like second nature to hide out in cash during these volatile markets, but investors ought to snap up bonds while the getting’s still good in yields, according to UBS. The Federal Reserve is about a year into its rate-hiking campaign and many suspect it will kick off yet another rate increase next Wednesday . The central bank’s policy tightening has had the upshot of boosting yields on bonds, certificates of deposit and other fixed-income instruments. Bond yields move inversely to their prices. Though banks are willing to pay more interest on CDs and savings accounts , investors seeking shelter in these cash products risk missing out on solid income from bonds. They also risk having the real value of these deposits eaten up by inflation, which remains high even as it’s been inching downward. “Cash deposits have become more appealing to many investors as central banks have tightened,” wrote UBS strategist Vincent Heaney in a Thursday report. “But this appeal is superficial, and we favor locking in yields and sticking with a diversified portfolio.” He noted that a balanced portfolio – one that’s 60% allocated toward stocks and 40% allocated toward bonds – beats cash about 80% of the time over a five-year period. That’s not to say that investors should redeploy all their cash into bonds immediately. Instead, they can make incremental investments into these assets over time, Heaney said. This is known as dollar-cost averaging. You also don’t have to take too much risk to pocket those attractive bond yields, particularly as worries of a widespread downturn weigh on investors’ minds. The rate on the six-month Treasury bill is 4.69%, while the 2-year Treasury is yielding 3.84%. “We favor high-quality government and investment grade bonds, which should be more resilient in the event of a recession,” Heaney added. – CNBC’s Michael Bloom contributed to this report.