The challenges that Tesla (TSLA -1.11%) has been facing are pretty well publicized. The electric vehicle (EV) business is dealing with a combination of slower sales growth and shrinking margins, primarily as a result of macro headwinds and competitive factors.

The company's recent fourth-quarter results missed analysts' revenue and earnings estimates, and shares have fallen 7% since issuing its Q4 report on Jan. 24 (as of Feb. 9). They currently sit 53% below their peak price.

But don't rush to buy on the dip just yet. In fact, you should forget about Tesla and consider buying this magnificent automotive stock instead.

It's all about luxury

Ferrari (RACE 2.49%) is a luxury car maker that I'm sure you've heard of. The Italian company is known for selling some of the most sought-after supercars on the face of the planet, with average selling prices that range in the low-to-mid six figures. Some exclusive models even sell for millions of dollars.

But Ferrari's unique in that its unit volume is tiny in the industry; the business sold just 13,663 vehicles in 2023. This is purely by design, and it's not because there isn't interest from consumers. It's a deliberate strategy to maintain the brand's status.

The company's profitability more resembles that of a luxury brand than a typical car maker. Ferrari's gross margin usually hovers around an impressive 50%. There's proven pricing power here. And just take a look at Ferrari's incredible financial performance: Revenue was up 17% last year, with diluted earnings per share rising 36%.

Owning a stock like this has to provide invaluable peace of mind for an investor. Ferrari targets ultra-wealthy consumers as its client base. These people are more insulated from the negative impacts of a possible recession. This should give investors lots of confidence that Ferrari should be able to still put up strong financial numbers in an economic downturn -- at least better than the vast majority of businesses out there, including Tesla.

Where Tesla struggles

Ferrari's ongoing success, especially right now, highlights the issues that continue to plague Tesla. The EV leader certainly deserves credit for spearheading the industry, prioritizing innovation, bolstering its manufacturing capabilities, and building a well-recognized global brand. But Tesla cannot escape the reality of being a car maker in the way that Ferrari has done.

Just look at recent trends over the past couple of years. In 2022, Tesla reported a superb operating margin of 16.8%, demonstrating its premium status that led to better profitability than the legacy automakers. But continuous price cuts, put in place to maintain Tesla's market share in a hypercompetitive industry, pushed the operating margin down to 9.2% in 2023.

The company's revenue last quarter increased by only 3% on a year-over-year basis, marking a significant slowdown from prior years. It's clear now that Tesla is sensitive to macro forces, something Ferrari can largely avoid.

The most important factor to consider

There is no shortage of reasons to like Ferrari's business. It possesses many attributes that make it a high-quality enterprise. But that doesn't automatically mean the stock is a buy.

That's because we have to consider the valuation. Shares continue marching higher, propelled by the latest quarterly numbers. The stock now trades at a price-to-earnings ratio of 52.6, which is 37% higher than its historical average. On a forward basis, this multiple is 47.3. This doesn't scream value. Investors are bullish on Ferrari's thriving business, and they have bid up the stock accordingly.

Those who are still comfortable with this valuation should initiate a position in Ferrari. It's easy to believe that the premium is warranted given the company's success. But if the valuation gives you pause, then it's probably best to be patient and wait for a better entry price.