To say that the stock market has been rocky over the past few weeks would perhaps be an understatement. Many investors are seeing substantial losses in their portfolios as tech stocks tank and the broad market follows suit. And many near-retirees are starting to worry that market conditions will force them to delay their workforce exits.

It's certainly not an easy time to be making investment decisions. But one decision you may want to make is to keep investing, even when the market is turbulent. Here's why.

A person wearing a business suit at a laptop.

Image source: Getty Images.

1. You might snag some discounts

Stock values are down right now. That's not a good thing when it means your IRA or 401(k) plan balance has tanked. But it does give you an opportunity to scoop up some investments on the relative cheap.

That doesn't mean you should go out and buy stocks with share prices that are sitting at 52-week lows. What it does mean, though, is that if there are stocks on your wish list, you might consider buying them now, when it's possible to score shares at a lower price point.

2. The stock market has a long history of recovering from downturns

Right now, stock market conditions are looking bleak. But this isn't the first time something like this has happened.

Think back to March of 2020, when stocks plunged into bear market territory in the wake of the COVID-19 outbreak. Back then, many investors were panicking, and understandably so. But after a brief (albeit intense) dip, the stock market went on to have a fantastic year.

All told, the stock market has a long history of recovering from hits like the one it's experiencing today. And if you invest now and leave your portfolio alone for many years, there's a good chance you'll end up making money.

How to invest when the market is rocky

When stocks are extremely volatile, you need to be strategic in your investment choices. A good bet in that regard is to stick to the companies you know and believe in.

That said, you might also consider branching out into different corners of the market so your portfolio is more diverse. That could actually buy you a degree of protection at a time when stock values are so precarious.

One option you may want to look at in that regard is buying REITs, or real estate investment trusts. REITs are known to pay higher-than-average dividends, and if you don't have any real estate exposure in your portfolio already, they'll give you some.

It also pays to consider putting some money into the broad market. Loading up on S&P 500 ETFs, for example, gives you instant diversification. And if you buy those shares when the broad market is down, there's a good chance they'll gain value in time.

Being an investor during periods of turbulence is far from easy -- even if volatility is something you're used to. But it pays to keep investing even when the market seems to be going nowhere but down. In the long run, it's a move that could really pay off.