McDonald's (MCD -0.91%) business has been firing on all cylinders lately. Sales are rising at a double-digit rate, profit margins are near record highs, and customer satisfaction is up. "The McDonald's brand has never been stronger," CEO Chris Kempczinski told investors in late July.

And yet the stock is trailing the broader market by a wide margin in 2023 due to one big worry on Wall Street: Investors are looking past the fast-food giant's positive momentum to focus on a predicted slowdown ahead into 2024.

What's this about a slump for McDonald's?

The Q2 earnings report contained only faint signs of an impending slowdown. McDonald's reported positive customer traffic and rising average spending across its key markets, including in the U.S.

Overall, comparable-store sales were up 12%, marking just a small deceleration compared to the prior quarter's 13% spike. Profitability improved to a record 44% of sales thanks to the combination of higher prices, cost cuts, and that expanding sales footprint.

Yet the company noted in its Q2 press release that "global macroeconomic challenges" are starting to pressure the industry. While noting in a conference call with investors that McDonald's is winning market share and seeing solid traffic, things are likely to change for the worse over the next few quarters.

The red flag for McDonald's

Specifically, McDonald's said there are four significant headwinds impacting the business heading into late 2023. "Costs remain elevated, consumer discretionary spending is limited, and industry traffic is pressured," CFO Ian Borden noted. "And as inflation begins to normalize later in the year, we expect top-line growth to moderate."

In other words, starting in the second half of 2023, price increases won't provide the sales lift that they have in recent quarters. And that pressure will be amplified by weakening consumer demand. This downbeat outlook helps explain why McDonald's, along with peers like Starbucks, underperformed the market in recent months, and it's a potential red flag to consider.

A broader economic slowdown is no big deal for McDonald's

It's still an overreaction on the part of Wall Street to abandon McDonald's stock in response to this news. The chain isn't losing a step against fast-food competitors, after all. In fact, McDonald's is leading the industry on core metrics like market share and profit margin.

Mickey D's is heading into this potentially challenging period with excellent momentum as well. Its ample cash flow provides all the flexibility that management needs to continue investing in growth initiatives even through a recession, should one develop into 2024.

In the meantime, investors can grab this fast-food stock at a discount. Shares are trading at about 7.5 times sales, down from a peak of 9 times sales earlier this year. The price-to-earnings ratio has declined even more, falling to 23 today from about 33 in late March.

It's true that this valuation drop reflects real concerns that McDonald's will report weaker sales trends over the next year or so. But the company has been through many prior industry pullbacks in the past few decades. Each time, it has emerged from the cyclical downturn to go on to set new sales and earnings records.

Smart investors know that this is the likeliest scenario for the next recession, whenever that occurs, so they see an opportunity in McDonald's latest stock price drop. There might be more volatility ahead in the short term, but the chain's wider outlook is as bright as ever.