After an incredible 18 months of growth, the stock market has been shaky over the past few weeks. September is historically a rough month for the stock market, and prices continued falling early in October -- leading some investors to believe that the market is on a downhill slide.

While there is some data suggesting that a market downturn could be on the horizon, it's far from definitive. It's impossible to predict when a market crash will occur, how bad it will be, or how long it will last.

That said, with the market being rocky right now, should you sell your stocks just in case a crash is looming? Here's what you need to know.

Person looking at a phone feeling worried

Image source: Getty Images.

Will selling your stocks protect your investments?

In theory, selling your stocks right before a market downturn is a smart strategy. You'll be selling when prices are still high, then you can reinvest once prices are at rock bottom to make a hefty profit.

In real life, however, this tactic is extremely difficult to pull off. Market crashes are unpredictable, and successfully timing the market is nearly impossible. It's also easy to lose a lot of money if you time the market incorrectly.

Say, for example, you believe a market crash is coming, so you sell all your stocks right now. The market may not crash, though, and stock prices could continue increasing. In that case, you've missed out on those potential earnings by selling. And because stock prices have increased, if you decide to reinvest, you'll end up paying more for your investments than what you sold them for.

In this scenario, you could simply keep your money out of the market indefinitely, since a downturn is bound to occur sooner or later. With that strategy, though, you could potentially miss out on even more earnings.

Say you sold your stocks in March 2020 when the market took a nosedive, for example. If you chose not to reinvest until the market crashed again, you would have missed out on one of the greatest bull markets in history.

^SPX Chart

^SPX data by YCharts

Hindsight is always 20/20, and it's easy to look back on previous market crashes and think about how much money you'd save by selling right before prices dropped. In the moment, though, it's impossible to know whether the market really is headed toward a crash or not.

The advantage of holding your investments

Rather than selling your stocks when the market is volatile, a better option is to hold your investments for the long term.

No matter how severe a crash is, you don't lose any money on your investments unless you sell. Stock prices may plummet, and your investments' value may sink in the short term. However, the stock market has historically always recovered from downturns. By holding onto your investments, there's a good chance they will bounce back eventually.

The key is to make sure you're investing in strong stocks. Not all investments are created equal, and not all companies will be able to pull through tough economic times. By investing in companies with strong underlying business fundamentals, though, your investments are more likely to recover.

Nobody knows for certain what the future holds for the stock market, but the good news is that you can take steps to protect your money. By investing in strong stocks and holding your investments regardless of what the market does, you'll be prepared for anything.