A bull market is when the prices of stocks are generally marching upward with no end in sight. For the most part, that's great news for investors: It's always satisfying to watch your portfolio's value rise higher and higher. But there's one significant problem that many investors tend to overlook: A long-running bull market can throw your portfolio's asset allocation entirely out of whack, greatly increasing your risk level.

Bull markets and asset allocation

Asset allocation refers to how you spread your money across the different types of investments you own. For example, most savers split their retirement investments between stocks and bonds; the stocks provide high average annual returns, while the bonds provide stability thanks to their low volatility. And by allocating your funds to multiple asset types, you insulate yourself from the risk that one particular type of investment will inflict a sudden and dramatic loss on your portfolio.

When the stock market turns bullish, the stocks in your portfolio will grow in value -- often rapidly and substantially -- but the bonds and other investments that you hold will not be able to match that growth. As your stock positions grow, they'll take up an ever greater percentage of your portfolio.

That's just fine as long as the bull market keeps running, but what about when it finally comes to a crashing halt? When a market correction occurs, the more you hold in stocks, the worse the impact will be on your entire portfolio.

Hand drawing chart trending upwards

Image source: Getty Images.

The price of overcommitting

For example, let's say you normally hold 50% in stocks and 50% in bonds. If you have $100,000 in total investments, that means you have $50,000 worth of stocks and $50,000 worth of bonds. However, if the stock market has been booming for a few years while the bond market has lagged, then those numbers may have shifted to something more like $75,000 in stocks and $55,000 in bonds. That means your allocation is now roughly 58% stocks and 42% bonds.

Now look at what happens when the stock market suddenly plunges by 20%. Assuming your own stock holdings roughly mirror the overall market's loss, your $75,000 worth of stocks would now be worth $60,000 -- a loss of $15,000 in value.

On the other hand, consider what would have happened if you had rebalanced your portfolio annually during the bull market by selling part of your stock holdings and putting that money into bonds. Let's say that instead of leaving $75,000 in stocks and $55,000 in bonds, you had restored your 50-50 asset allocation by selling off $10,000 in stocks and investing that money in bonds. In that case, when the stock market suffered its 20% correction, your $65,000 stock position would have dropped to $52,000 -- a loss of $13,000 of value. While that would still be painful, you would at least have improved your portfolio's overall position by $3,000 compared to what would've happened if you hadn't rebalanced.

Understand that the example above is far from a worst-case scenario. Stock market corrections considerably greater than 20% have occurred more than once, and many investors are tempted to keep extremely high percentages of their portfolios in stocks when the markets are running hot. Just imagine how bad the losses would be if the fictitious investor in this example had kept 90% or 100% that portfolio in stocks, instead of just 60%.

Now take a look at your own portfolio and see what percentage of it is in stocks. What would happen to your portfolio if the stock market crashed tomorrow?

So should I shun stocks entirely?

Some investors, particularly those who've already felt the pain of a severe market crash, decide to go in the other direction and pare down their stock holdings to a tiny sliver of their portfolio. Unfortunately, that can be just as big a mistake as holding on to too much stock.

The stocks of companies with large market capitalizations have produced an average annual return of around 10% since 1926. Government bonds, on the other hand, have returned between 5% and 6% over the long term. Meanwhile, inflation has averaged roughly 3% per year over the last 100 years. That means that you must subtract 3 percentage points from those long-term returns to get the true return on investment.

So government bonds have really only returned between 2% and 3% per year versus around 7% for stocks. If your goal is to build wealth, neglecting stocks in favor of bonds will considerably hamper your efforts.

How and when to rebalance your portfolio

Remember the classic stock mantra, "Buy low, sell high"? If you're in the middle of a bull market, that means stock prices are high -- so it's the perfect time to sell some. Unless your investments have barely budged, it's a good idea to rebalance your portfolio on an annual basis. During bull markets, this will entail selling off some of your stock holdings and using the proceeds to buy bonds; when the stock market is faltering and bonds are taking off, you'll do the opposite. It may hurt a little to sell a stock that's growing at an annual rate of 20%, but you'll be awfully glad you did when the party ends and the stock's price takes a nosedive.

If you wait until a market correction occurs and then sell your stocks, you're selling low instead and locking in those big paper losses. What's more, by selling your stocks after the correction has occurred, you'll miss the market rebound that will sooner or later send stock prices climbing again.

Deciding on the exact percentage of stocks and bonds you should hold in your portfolio is complicated; indeed, entire books have been written on this one subject (though if you're looking for a place to start, this asset allocation article can help). However, one rule of thumb that typically works well for retirement investments is to subtract your age from 110 and keep that percentage of your investments in stocks, with the remainder in bonds.

This puts a hefty chunk of your retirement savings in stocks when you're young and have time to recover from market slumps. And as you approach retirement, when you'll need to start drawing on those investments for income, the bulk of your holdings will shift to bonds, which are better for preserving wealth than for growing it.

The Motley Fool has a disclosure policy.