Like many growth stocks, Home Depot (HD -0.31%) set its all-time high in late 2021. That time period was marked by soaring optimism as the pandemic threat faded and consumer spending surged. Wall Street projected that the good times would never end, especially as cash poured into the housing and home improvement industries.

That optimism shifted over the following year. Home Depot stock has declined 23% since early 2022, compared to an 18% drop in the S&P 500. There are worries about a recession on the way and a potentially prolonged period of weak housing demand ahead.

With that backdrop in mind, let's look at whether Home Depot represents an attractive buy at today's discounted price.

Short-term pain

The answer to that question will largely depend on your time horizon. Home Depot is entering 2023 with several pressures on the business that shareholders haven't seen in many years. Customer traffic was down by a significant 5% in the nine-month period that ended in late October. It was up 1.3% in the same stretch in 2021, by contrast.

Rising prices and continued spending on the part of profession contractors has helped the business continue growing, even compared to peers like Lowe's. Yet most Wall Street pros are projecting low-single-digit sales growth in 2023 compared to a 14% spike in 2021. The housing market is already slowing as mortgage rates rise.

Long-term growth

Home Depot is still likely to be setting new sales and earnings records several years down the road, though. It won market share through late 2022, for example, thanks to its larger sales footprint that covers both do-it-yourself consumers and professional contractors.

The chain also has a thriving online business that ranks among the biggest in the retailing world. It has navigated every previous recession and downturn in the past few decades as well, including the collapse in the housing industry during The Great Recession.

That's why, if you can measure your return in years rather than months, owning the stock through the next upswing should be easily worth the extra risk involved surrounding weak growth over the next few quarters.

Brace for volatility

It's not hard to see why many investors avoided Home Depot stock in the past year. The housing market has been on an almost uninterrupted tear for over a decade, supported by interest rates that sat at historic lows for that entire time. The end of that low-rate era, plus the prospects for a growth hangover ahead in 2023 and beyond, has Wall Street fearing that the consumer discretionary retailer will have to settle for weaker profitability than the blazing 15% of sales that shareholders have seen in recent years.

HD Operating Margin (TTM) Chart

HD Operating Margin (TTM) data by YCharts

On the other hand, Home Depot is one of the more efficient retailers on the market, pays a generous dividend, and is primed to lead the home improvement industry out of the current downturn once that shift occurs.

In the meantime, investors should consider the almost 20% discount on the stock as another compelling reason to put Home Depot in their watch lists, if not in their portfolios.