When the stock market is in a funk, as it is now, down 25% so far this year and firmly in bear market territory, it's easy to forget the power of a simple buy-and-hold investing strategy. Because every steep correction is invariably followed by a bull market, one that tends to go far higher than the previous peak before the downturn hit, those valleys tend to smooth out until they hardly even register on a stock chart.

Bear markets are also typically measured in months, while bull markets are measured in years. Since 1928, the average bear market has lasted 15 months, while the average bull market rally has lasted three years. Even better, from 1970 on, bull markets tend to last more than six years on average.

Person flipping through pile of hundred-dollar bills.

Image source: Getty Images.

Millionaire's row

We can see how that's played out with this pair of stocks that had their IPOs 25 years or more ago and have turned a $5,000 investment at their IPO into almost $6 million or more. An investor who bought shares and simply held on through market crashes, recessions, global financial crises, and pandemics could have become fabulously wealthy.

Company

IPO Date

Value of $10,000 Invested at IPO

CAGR %

Amazon (AMZN)

5/15/1997

$5.75 million

34%

Home Depot (HD)

9/22/1981

$69.41 million

27%

Data source: Ycharts. Table by author.

Here's a deeper dive into each.

1. Amazon

Amazon's stock has been buffeted by consumer spending worries, as shares have fallen by a third this year. Yet it just completed its second major sales event called Prime Early Access Sale as it sought to get a jump on the holiday shopping season. The company said tens of millions of Prime members participated in the extravaganza, buying over 100 million items from its third-party partners.

There is the risk that all Amazon is doing is pulling sales forward into October from November and December, but it also serves to handicap competing retailers, which might not see as big of a sales rush as they might otherwise enjoy.

E-commerce, however, continues to grow with year-to-date sales through July up 11% to $740 billion, and online sales now represents 14.5% of all retail sales. Most importantly, Amazon is the first place consumers turn to when they start looking for goods to buy online.

Retail, of course, isn't even Amazon's primary growth center, even if it is its largest revenue generator. Amazon's cloud services business Amazon Web Services (AWS) holds the distinction of being the main profit driver, with sales continuing to rise at high-double-digit rates.

Amazon has been through numerous market cycles, including the dot-com crash, where it lost 95% of its value. As you can see, not panicking at a collapse and holding tight still generated phenomenal returns.

2. Home Depot

Home improvement center Home Depot has had a similar fall from grace this year, with its stock down more than 31%. Rapidly rising interest rates is putting a damper on the housing market, a key driver of the retailer's business.

U.S. home sales dropped for the seventh consecutive month as home prices remain elevated despite falling demand. Still, demand hasn't fallen below available inventory yet, so there remain more buyers in the market than homes for sale.

Of course, that could soon change. Homebuilder confidence is down for the ninth straight month, while building permits for new houses plummeted to their lowest level since 2020. 

Because Home Depot relies more heavily on contractors than does rival Lowe's, with the professional customer representing 45% of annual sales versus 20% to 25% for its rival, it may more acutely feel the impact of any falloff. That could be somewhat offset by homeowners choosing to fix up their existing dwelling instead of buying a new home, which could lead to further sales, though inflation may negate some of the benefits of that happening.

Certainly Home Depot isn't recession proof, but it has been through this before, most recently during the housing market collapse following the Great Recession in the mid-2000s. Back then the DIY center lost 60% of its value but went on to gain over 1,300% over the ensuing years. No doubt if we go deep into a recession again, Home Depot will feel the effects, but it also seems clear it will come through the other side in fine shape and go on to greater gains.