Investors have seen volatile markets over the past year and a half, as long gains since the end of the financial crisis in 2009 have finally given way to choppier market movements. Many key stock indexes have made no real progress since early 2018, and despite a strong U.S. economy, fears of a global economic slowdown and recent tensions on the trade front have combined to make investors increasingly nervous about what the future might bring.

If you're sitting on big gains on your investments since the late 2000s and early 2010s, then it might seem like now's a good time to sell everything in advance of a bear market. Yet if you're truly a long-term investor, accepting the ups and downs of the stock market is part of the price you pay for the impressive returns that stocks have produced over time. Instead of making an abrupt move to get out of stocks entirely, doing some targeted selling to rebalance your portfolio can help you get your risk levels back in line with your comfort zone.

Seesaw with black pellets on one end and white cubes on the other.

Image source: Getty Images.

The asset allocation dilemma

If you're like many investors, you've probably filled out a risk tolerance questionnaire at some point. These instruments are popular among financial advisors, and they're designed to help you figure out what percentage of your overall portfolio you should allocate across various types of investments.

For instance, for a young person who's just starting out and has a long time horizon, most risk tolerance questionnaires will urge a large allocation to stocks, with minimal amounts for bonds and cash. As you approach retirement, asset allocations usually gravitate toward less volatile investments, producing smaller allocations to the stock market.

Yet what happens during a bull market is that asset allocations often get way out of balance with your initial expectations. For example, say that you started out in 2009 with a $100,000 portfolio, 50% of which is in an S&P 500 index fund and the other 50% in a broad-based bond market fund. The stock portion of your portfolio has climbed almost 265%, while the bonds have seen about a 45% rise, both including interest and dividend payments. That means that the $50,000 you originally had in stocks would be worth about $182,000, while the bond portion would be worth just $73,000. That works out to a 71%-to-29% split -- quite a long way from the original 50%-50% allocation.

With stocks having done so well, it might be tempting just to keep the higher allocation there. Yet what that does is expose you to additional risk beyond what motivated your initial decision to go with a 50%-50% split. If the stock market falls, your losses will be worse with a 70% allocation than they would've been with a 50% allocation.

What you have to do to rebalance

If you discover a similar imbalance in your asset allocation, then the solution is to take some of your assets in the more heavily weighted portion of your portfolio and sell them, using the proceeds to buy the less heavily weighted asset. In the example above, to get back to a 50%-50% split, you'd need to sell off about $55,000 from your stock portfolio and use it to augment your bond allocation.

After a long period of gains, you have to be a bit careful in exactly how your execute your rebalancing transactions. The challenge is that selling appreciated stocks will create taxable gain if you hold them in a taxable account. The better move is to use tax-favored retirement accounts to make asset allocation shifts, because any sales or exchanges you make won't be taxable events.

Another alternative is to change the way you allocate new money to your portfolio. For instance, if you're only out of balance by about $1,000 and you contribute $100 per month to your savings, then directing that $100 entirely to the less heavily weighted asset in your portfolio will get you rebalanced in less than a year. Since you're making the move with new purchases, there won't be any tax consequences even in a taxable account.

Now's the time to act

As market volatility continues, it's a good time to take a closer look at how your portfolio assets are allocated. If they're a lot different from what you'd be comfortable with, then rebalancing your portfolio can get your risk level back to where it ought to be and make you feel a lot more prepared for whatever comes next for the stock market.