It hasn't been a good year for stock investors. Of course, for those with a long-term bias toward stock selection, this is a good thing: It's easier to find bargains when other investors are heading for the hills. Once-story stocks are now value stocks.

Is the same true for real estate?

Real estate prices haven't yet taken the same hit as stocks, but there are hints that it's coming. That said, I think it could still be a good time to buy real estate, as long as the following three things are true: You find values, you have plenty of reserves, and you keep a long-term perspective. Here's a look at each factor.

People finalizing a real estate deal.

Image source: Getty Images.

1. How to find value

Value is key in both stock and real estate investing. You could find the best multifamily building ever, but if you overpay and can't even make debt payments with the cash flow, you could end up taking a loss. And after a few years of gangbusters returns in real estate, there aren't a lot of values left.

Look at cash-on-cash returns for prospective investments. Calculate what your cash flow would be from the property and divide it by the down payment. Cash-on-cash returns are similar to capitalization rates but take financing into account, so your cash-on-cash return should be higher than the cap rate. You can compare this return to the dividend yield on a real estate investment trust (REIT).

Set a cap rate hurdle, and don't buy if you can't meet that hurdle. You can get creative -- if a property hasn't performed as well as it could, figure out what the market rent would be and use that in your analysis. Also, keep in mind that any repairs or deferred maintenance that you end up taking care of should be added to the down payment amount because it is an investment that you're making.

2. Keep sufficient cash reserves

A downturn in stocks doesn't necessarily mean a recession will follow, but it's good to be prepared just in case. If the stock market, inflation, supply chain problems, and worker shortages do cause some level of economic recession, you may be stuck with extended periods of vacancy.

If that happens, you need to have reserves. All real estate investments come with fixed and variable costs. Fixed costs are things like property tax and mortgage payments, and variable costs are things like property management fees and utilities. If no one is occupying your property, you won't have to pay the variable costs, but you'll still be on the hook for fixed costs.

Reserves are the business equivalent of a rainy day fund. Most of the time, they sit unused in a bank account accruing not much interest, but when you need them, they save the day. A good rule of thumb is to keep six months or so of reserves at all times. Calculate what your monthly fixed costs are, and multiply that by six. If you're extra anxious about the economy, keep a full year's worth. It may also be a good idea to figure out if there is deferred maintenance (like a furnace that will need to be replaced soon) and start saving for that specifically.

3. Investing for the long term

In the stock market, it's hard to have a long-term focus. Every minute, the market is shouting a price at you. If a stock price is down 60% or even 80% in the last year, it gets really hard to stay the course.

Real estate investing just isn't as active. Maybe your neighbor who has a similar house will sell, and it's 10% less than you paid, but who cares? As long as you have good, or even no, financing, it doesn't matter. Keep the place rented to keep generating cash flow and making debt payments. If you're making payments, usually the bank doesn't care if the price goes down.

In real estate investing, building equity and making cash flow is what matters. You don't buy a rental property with the intent of selling it. You buy it to collect rents and use them to pay down the debt. If you can do that consistently, market price just doesn't matter.