When COVID-19 cases began increasing domestically, it quickly became clear that every aspect of life was going to change overnight. And that included the stock market. In March, stocks plunged into bear market territory, sending investors on a wild ride that, months later, seems to be going much smoother. In fact, stocks have managed to recover nicely from the beating they took earlier in the year. But in spite of that, the U.S. economy is still in a recession. Unemployment levels are still in double-digit territory, an eviction crisis is looming, and surges of COVID-19 throughout the country make the threat of a second massive lockdown very legitimate.

At a time like this, you may be wondering if it's a good idea to invest your money in stocks, and generally speaking, the answer is yes. Though stocks can be volatile during a recession, the upside is that you may have an opportunity to score quality investments at a discount.

But in some cases, investing during a recession is a dangerous move. If any of these factors apply to you, you may want to hold off on buying stocks.

Man staring at laptop screen

Image source: Getty Images.

1. You don't have enough emergency savings

Your No. 1 financial priority should always be having enough money in the bank to cover your near-term bills in the absence of a paycheck. An emergency fund with three to six months' worth of living expenses will suffice when the economy is strong, but in a recession, you should really try for six months' worth of living costs at a minimum. If you don't have that amount of cash tucked away in the bank, then you're better off waiting to invest right now.

The reason? Imagine you put $10,000 in stocks, and unfavorable COVID-19 news causes your portfolio to lose $3,000 of value on paper or on screen in the course of a week. (Yes, that can happen. Easily.) If, at the same time, you've lost your job and need money but don't have enough in the bank, you may have no choice but to cash out investments when they're down, thereby locking in that $3,000 loss instead of waiting things out and letting your portfolio recover. As such, a healthy emergency fund is really a prerequisite to investing, especially during a recession, so if you don't have one, you'll need to hang tight and boost your savings before buying stocks.

2. You don't plan to keep your money invested for the long haul

As a general rule, you should only invest money you don't plan to touch for at least seven years. That gives you a nice window of time to recover from stock market losses. Even if you have an emergency fund, if you're sitting on excess cash you plan to use for a down payment on a home in a year or two, don't put that money into stocks right now. If you do, you'll risk locking in losses when you liquidate investments to come up with that down payment.

3. You don't trust yourself not to panic sell

Investing in stocks can be a nerve-wracking experience in general. In a recession, it can be downright terrifying. If you're going to buy stocks right now, you must pledge to not obsess over your portfolio balance. The more you check up on your investments, the more likely you are to sell off stocks in a panic in an effort to minimize losses (when really, all you'll be doing is locking in those losses). If you don't trust yourself to stay cool and avoid rash decisions, you may be better off investing at a different time.

There's lots to be gained by investing right now, but only if you're really ready for it. And if you're not, that's OK. A lot of people are dealing with income insecurity and other concerns as the pandemic rages on, and if you're not financially or mentally equipped to deal with investing at this point in time, don't do it. What you should do, however, is use this time to set yourself up to invest in the future. Pad your emergency fund if it's not as robust as it should be, and set aside cash for other near-term goals so that when you're ready to invest, you can commit to a long-term strategy. It's a much better bet than investing at the wrong time and regretting it after the fact.