One of the greatest challenges of being a long-term investor is enduring market cycles. It can be downright perplexing to see individual stocks and sectors go from in favor to out of favor on a whim. But steep sell-offs and volatility can present impeccable buying opportunities for patient investors.

As a recent example, note that in 2020 the three worst-performing sectors in the S&P 500 were energy, real estate, and financials. The reverse was true the following year, as energy, real estate, and financials were, in order, the three best-performing sectors of 2021. While investors shouldn't expect these kinds of rapid reversals over the short term, it's worth noting that sharp price movements aren't always grounded in fundamentals and can have nothing to do with a core investment thesis.

Bear markets have historically presented impeccable buying opportunities -- but only for companies that have what it takes to overcome obstacles and grow over the long term. Here's why Microsoft (MSFT 0.37%), Ford Motor Company (F 0.08%), The Trade Desk (TTD 3.35%), Vertex Pharmaceuticals (VRTX -1.02%), and Procter & Gamble (PG 0.68%) stand out as five compelling buys now.

A person looks at a computer and smiles while holding a tablet and leaning on a desk that consists of color pallets, various writing utensils, and other materials.

Image source: Getty Images.

Indispensable software products and cloud services

Trevor Jennewine (Microsoft): Microsoft saw its share price tumble more than 7% following its earnings report for the first fiscal quarter (ended Sept. 30, 2022). Revenue rose 11% to $50.1 billion, a big deceleration from 22% growth last year, and earnings fell 13% to $2.35 per diluted share. Worse yet, guidance came in short of Wall Street's expectations, as CFO Amy Hood said weak PC demand would persist into the second quarter, negatively impacting revenue from Windows and Surface devices. Hood also said ad spend on LinkedIn and Bing Search would likely suffer too.

However, things aren't as bad as they seem. Revenue actually climbed 16% when unfavorable foreign exchange rates are stripped out, and earnings climbed 11% when adjusted for a one-time tax benefit last year. Additionally, temporary economic headwinds may put pressure on Microsoft in the near term, but they leave the long-term investment thesis unchanged. That means short-sighted shareholders who sold the stock have created a buying opportunity for patient investors.

The bull case for Microsoft is straightforward. The company offers a range of mission-critical software and cloud services, and it has achieved a strong presence in several end markets. Most notably, Microsoft 365 brings together industry-leading tools like Office 365 for productivity, Power BI for business analytics, and Teams for communication and collaboration.

Microsoft is also a strong contender in several cybersecurity verticals -- access management, endpoint protection, security information, and event management -- and its security customer count jumped 33% to 860,000 in the most recent quarter. That puts Microsoft in front of a large growth opportunity, as the cybersecurity software market is expected to increase at 12% per year through the end of the decade, reaching $500 billion by 2030, according to Grand View Research.

Finally, Microsoft Azure is the second-largest cloud services provider. It trails Amazon Web Services by a wide margin, but it has twice as much market share as the third-place contender, Alphabet's Google Cloud. That bodes well for the future. Grand View Research estimates that cloud computing spend will grow at about 16% annually to approach $1.6 trillion by 2030.

Currently, Microsoft's share price sits 32% off its high, marking its greatest drop in the last decade. That's why this stock is worth buying in November.

This long-term growth story is intact

Neha Chamaria (Ford): With Ford shares losing more than one-third of their value in 2022 so far, investors were pinning hopes on the auto giant's third-quarter numbers for some respite. Unfortunately, Ford reported a huge net loss for the quarter and trimmed its forecast for adjusted earnings before interest and tax (EBIT) for the full year.

Yet, Ford just made a smart business move, and while that may have driven its Q3 losses higher, it shows how management is focused on high-growth areas even if it means making some tough decisions. Also, it's not that Ford isn't growing at all, which is why you'd want to give Ford stock a serious look while the market harps on near-term blips.

Ford is facing a problem with supply, not demand. At the end of September, Ford had nearly 40,000 vehicles in inventory that couldn't be sold because of a shortage of parts. Yet it still grew its revenue by 10% year over year in Q3 on robust demand and expects supply challenges to ease in the coming quarters. In fact, Ford expects its wholesale shipments -- or units sold primarily to dealers -- to rise 10% in 2022. Also, Ford's adjusted EBIT guidance of $11.5 billion for the full year still translates into nearly 15% growth over 2021.

In short, Ford may not be growing as fast as investors want it to, but it is growing at a decent pace despite the macroeconomic headwinds. Ford's electric vehicle (EV) sales are booming as well -- they tripled year over year in the month of September, with its F-150 Lightning pickup truck selling like hotcakes. And to double down on viable autonomous technologies, Ford will now build Level 2 and Level 3 self-driving technologies internally even as it announced plans to shut down Argo AI. It looks like a prudent move as Argo AI was focused on Level 4 technology, and so far, fully self-driven technology has proven to be more difficult than expected to develop and commercialize.

A big write-off on its Argo AI investment may have hit Ford's bottom line in Q3, but that shouldn't detract you from the steady growth in Ford's shipments, EV sales, and cash flows. Not to mention its growth plans. 

Booming business amid a sectorwide slowdown

Anders Bylund (The Trade Desk): I love to buy shares of excellent companies while they are cheap. That's a key ingredient in the classic investing mantra to "buy low, sell high." It's even better when the company's business is booming, even though Wall Street tossed the stock in the bargain bin due to a systemic weakness in the relevant sector. A mismatch between expected weakness and robust results sets the stage for wealth-building returns in the long run.

That's exactly what I see in The Trade Desk right now. The stock trades roughly 40% lower year to date as investors wrestle with widely reported slowdowns in online advertising sales. The market reaction makes sense at a glance, since The Trade Desk makes its money by running automated digital ad campaigns on behalf of other companies.

However, The Trade Desk's business is firing on every available cylinder. Sales increased by 35% in the second quarter, compared to the year-ago period. Revenue, free cash flows, and cash reserves are skyrocketing, often leaving analyst estimates in the dust:

TTD Free Cash Flow Chart

TTD Free Cash Flow data by YCharts

The secret to The Trade Desk's success in a weak market is simple. Penny-pinching marketing campaign managers want to make the most of every ad-budget nickel in these challenging times. That's what The Trade Desk does best, adding data-driven value to its clients' advertising efforts.

The company is set to report third-quarter results on Nov. 7. These reports don't always send share prices skyward, even when The Trade Desk presents impressive surprises on the top and bottom lines. Still, we are most likely about to get our hands on yet another piece of evidence that this company can thrive in a difficult market. Whether you buy The Trade Desk now at a deeper discount or wait for cold, hard financial gains in the earnings report, early November looks like a great time to pick up a few shares.

Rising from today's modest starting price, this stock can make you plenty of money in the long run.

A winner with even better days ahead

Keith Speights (Vertex Pharmaceuticals): As 2022 winds down, the odds of the U.S. entering a recession appear to be increasing. Many, if not most, stocks will probably decline during an economic downturn. However, Vertex Pharmaceuticals is an exception. It's the kind of stock that's likely to thrive in a recession.

Vertex is certainly defying the bear market right now. The biotech stock has soared more than 40% year to date. I think this winner has even better days ahead.

All Vertex needs to do to continue growing its revenue and earnings is snag additional reimbursement deals and regulatory approvals for its existing cystic fibrosis (CF) drugs. That shouldn't be very difficult, in my view.

The company and its partner, CRISPR Therapeutics, hope to soon file for regulatory approvals of exa-cel in treating rare blood disorders beta-thalassemia and sickle cell disease. I think the prospects for Vertex to have another future blockbuster in its lineup with the gene-editing therapy look bright.

Vertex's pipeline also features three other promising late-stage programs. It could have yet another powerful CF therapy with the triple combination of VX-121/tezacaftor/VX-561. Non-opioid pain drug VX-548 has tremendous potential. Inaxaplin (VX-147) could be an effective treatment for APOL1-mediated kidney disease, an indication with a larger patient population than CF.

A recession wouldn't cause Vertex's CF therapy sales to decline. Neither would macroeconomic issues impact the company's drug development programs. With the signs pointing toward the economy potentially heading south, I think Vertex is an ideal stock to buy in November to weather the storm.

Procter & Gamble's consistency is unrivaled

Daniel Foelber (Procter & Gamble): Currency weakness and inflation are taking a sledgehammer to the performance of U.S.-based companies -- particularly conglomerates with international exposure. Procter & Gamble (P&G) generates just over half of its sales from outside North America. A strong dollar means that international sales are effectively discounted relative to domestic sales, which impacts profitability.

In its Q1 fiscal 2023 presentation, P&G forecasted a staggering $3.9 billion in full-year fiscal 2023 headwinds due to inflation, commodity, and currency-related factors. The $3.9 billion translates to an earnings per share (EPS) headwind of $1.57, or 27% of its full-year forecast. 

Despite this challenge, P&G is still forecasting flat to 4% core EPS growth in fiscal 2023, which is incredibly impressive given the impact of the headwinds discussed. P&G plans to distribute $9 billion in dividends in fiscal 2023 and will likely raise its dividend for the 67th consecutive year. However, it's buying back less stock, with direct share repurchases at an estimated $6 billion to $8 billion compared to $10 billion in fiscal 2022. 

P&G's consistency deserves a premium valuation, no matter the market cycle. Even in the face of challenges, the company generates ample free cash flow to support a growing dividend and buybacks. After all, free cash flow used on dividends and buybacks is effectively cash that the company doesn't need to run the core business. Investors would be hard-pressed to find a company that is better insulated from economic headwinds than Procter & Gamble. Its 22.9 price-to-earnings ratio isn't all that inexpensive relative to the rest of the market. But the quality of its dividend (yielding 2.8%) makes P&G one of the most reliable ways to generate passive income.