More than $2 trillion dollars is invested in target-date retirement funds (TDFs), the ingenious device that has simplified the diversification challenge for millions of savers and surreptitiously encouraged patient buy-and-hold investing.

A TDF owns a predetermined mix of stocks, bonds, cash and sometimes alternative investments such as real estate investment trusts (REITs). The percentage devoted to each asset class depends on the saver’s expected retirement. A 2020 target-date fund, for someone retiring right about now, will own less in stocks than a 2050 TDF for someone whose retirement is three decades off.

Once an investor chooses a TDF pegged to an expected retirement date, they can sit back and let the fund do all the heavy lifting.

But during the market meltdown that hit in mid-February, many TDF investors close to retiring seem to have lost their patience. According to Morningstar, there was more TDF selling among near-retirees than any other age group.

It’s understandable for anyone near retirement to feel extra anxious. After decades of saving, you are wrestling with the scary proposition of needing to rely on all that saving to help support you for the rest of your life. That’s a daunting task that can make it harder to stay committed to a long-term strategy. Flight, rather than fight, can take hold.

It’s understandable, but likely not in your best interests. A few considerations:

• You may be retiring; your portfolio isn’t. You are focused on an approaching retirement date, but that’s sort of irrelevant for your portfolio, which has years of work ahead of it.

• You likely have another two or three decades to go. There is a strong possibility that you will live past your mid-80s. Understanding longevity is an overlooked key to retirement planning success.

• This too shall pass. If you are near retirement, you have likely experienced three or four bear markets. Once you remind yourself about longevity, it should be easier to take a deep breath and know that stock recoveries typically take just two or so years once the bear market ends. And don’t forget about your bonds. They rose in value in the first quarter.

• Too much cash is actually dangerous. Right here and now, owning cash feels great because stocks have already taken one harrowing drop down the roller coaster and we are not sure if more are ahead. But you want to resist putting too much of your retirement savings in cash.

A popular retirement strategy is to figure out how much monthly income you will need your portfolios to generate when you retire, beyond what you are guaranteed to get from Social Security, a pension payout if you have one, or an income annuity you have purchased. So if you will have $2,500 in guaranteed monthly income coming from Social Security and other guaranteed income sources, but you need another $500 to cover essential living costs, you will need to cover that other $500 from your own savings. The bucket strategy is to put two or three years of what you will need in cash, and keep the rest in a mix of stocks and high-quality bonds.

Once again, your longevity is the reason you should not pile more of your money into stocks. Prices rise over time. Even if inflation stays at a moderate or low rate, the safe low yields of cash will likely not keep pace with inflation. An older you needs some stocks to help generate inflation-beating gains that can help pay the bills when you are in your 80s and 90s.