For many people, including me, falling interest rates have been the general trend in the bond market throughout our working lives. At the beginning of 1983, the year I graduated from business school, the yield of the benchmark 10-year U.S. Treasury note stood at more than 10%. It was less than 2.5% at the beginning of 2017.

Because bond prices move in the opposite direction from rates, my career happens to have overlapped with the greatest bull market for bonds in history.

It appears that may be changing. And, of course, there’s no shortage of advice about how to prepare for the shift.

Rates may be headed higher (really)

This bond bull market has reminded us time and again just how hard it is to predict when rates will rise or fall and by how much. If you follow bonds, you might recall the markets bracing for a sustained rate increase back in 2010 as the economy pulled out of recession, or again in 2013 when the Federal Reserve said it would start tapering its bond purchases, or again at the end of 2015 when the Fed raised short-term rates for the first time in almost a decade. And yet, prognostications notwithstanding, interest rates remained anchored near historical lows.

That said, rates seem to be on an upswing. With economic activity picking up, wages starting to move higher, and inflation coming off recent lows, the Fed has nudged short-term rates higher twice in recent months and has signaled that further gradual increases are likely through 2018. The perceived pro-growth stance of the new U.S. administration also has played a role in framing a case for higher rates.

Short-term pain, longer-term gain

Bond investors are understandably concerned. If interest rates shoot up, the market value of bonds will drop sharply, with prices falling to bring yields in line with the new, prevailing higher rates. That’s the potential short-term pain. But long-term investors should actually want rates to go up. If you like bonds that pay 2%, you should love bonds that pay 4%, right?

There’s a simple—though imperfect—rule of thumb that helps make this point clear. If the time frame of your investing goal exceeds the time frame of your bond portfolio (a medium-term goal matched with short-term bonds, or a long-term goal paired with bonds not quite as long-term), rising rates will work out in your favor, maybe decidedly so.

Think of it this way: If you have a big cash need in the near future—say, a tuition bill coming due in a few years—and you own bonds that are long-term in nature, this time frame mismatch could spell trouble if rates rise sharply; you’d be selling bonds that would be worth less. But if you’re saving to retire 10 or 15 years down the road and rates are steadily rising, over time you’ll be earning higher and higher yields. Josh Barrickman, our head of fixed income indexing for the Americas, calls it “the virtuous cycle of compounding interest at a higher rate.”

The bottom line is, you can end up better off than if rates hadn’t risen because you’re earning more income, which over time more than washes away any price hit.

Beware of short-sighted, short-term moves

This logic can be difficult to grasp, tempting anxious bond investors to make drastic shifts to lessen the immediate pain of rising rates. Unfortunately, such moves can backfire.

Taking shelter in short-term bonds, for example, might seem like a good idea. Their prices generally hold up better than those of longer-term bonds in a rising-rate environment. But they also offer less income.

For example, when the market started worrying about rising rates in 2010, moving into short-term securities—and staying there—would have been costly. Through 2016, those securities returned roughly half of what the broad U.S. bond market did.

Favoring high-yield bonds is another tack some investors take, expecting higher income to help cushion price declines. High-yield securities, however, typically perform best when stocks are rising, making them unlikely to zig when stocks zag.

We saw clear evidence of the correlation between stocks and high-yield bonds in the frantic markets following the United Kingdom’s vote to leave the European Union last year. From June 23 to June 27, both U.S. stocks and U.S. high-yield bonds lost ground. The broad U.S. bond market, meanwhile, climbed 1.2% as investors sought a safe haven.

Your portfolio is more than the sum of its parts

Different assets have different roles to play in a balanced and diversified portfolio. Stocks are valuable because they can produce higher returns over time, while bonds can provide a crucial counterweight to the volatility of stocks.

Perhaps the most important thing to keep in mind about bonds is that although their prices can fluctuate, they remain “fixed income” securities. Barring default, you can be certain of getting income until the bonds mature. It’s that income that drives returns for patient bond investors who resist the urge to jump in and out of the market.

A lot has changed since I first started following the bond market, but the important role that bonds can play in a balanced and diversified portfolio hasn’t.

Notes:

All investing is subject to risk, including the possible loss of the money you invest. Bonds are subject to the risk that an issuer will fail to make payments on time, and that bond prices will decline because of rising interest rates or negative perceptions of an issuer’s ability to make payments.

Diversification does not ensure a profit or protect against a loss.

Past performance is not a guarantee of future results.