Many investors have reservations about buying shares of a company trading near all-time highs. In my opinion, two of the biggest stock market myths are "stocks that go up must come down," and "stocks that have plunged are due to rebound." The truth is that some stocks decline but never rebound, and investors are stuck trying to catch a falling knife, as the saying goes. Other times, stocks can trade at sky-high valuations indefinitely.

So if you're concerned about owning shares of a unique automaker as it floats near the stratosphere, don't be. Here's what makes Ferrari (RACE 1.02%) special, and why you should consider buying shares even near all-time highs.

A red Ferrari F8 Tributo, with mountains in the background

Image source: Ferrari.

Investing 101: Economic moat

If you were writing a paper on economic moats -- which are, simply, sustainable competitive advantages -- Ferrari would be a perfect example. Generally, a firm's competitive advantages will deteriorate over time, as competitors have a financial incentive to duplicate its approach, or find a better method to capture market share or higher profits -- more on this in a moment.

Ferrari's moat is based on its ultraluxury brand image, formed over decades of racing dominance and insanely exclusive car sales, which supports eye-popping pricing power. Unfortunately for most automotive investors, an automaker such as Ford, Toyota, or General Motors will simply never have the brand image or pricing power that comes attached to a Ferrari. For Ferrari investors, that's powerful.

To see just how powerful Ferrari's brand image, pricing power, and profitability are, let's take a look at two graphs.

RACE Operating Margin (Annual) Chart

RACE Operating Margin (Annual) data by YCharts.

Operating margin is a measure of profitability; it tells you how much of every dollar remains after subtracting costs of goods sold and operating expenses. Luxury goods carry higher operating margins because consumers are willing to pay more for a similar product with a brand name, and more of each dollar goes to the bottom line.

Manufacturing cars is expensive, as you can tell from the chart -- the majority of automakers post operating margins in the single digits. Ferrari, however, is able to command incredibly high average transaction prices for its vehicles, and is able to translate that into profit that resembles an ultraluxury goods manufacturer rather than an automaker. Consider this: Ferrari generated over $1 billion in revenue during the second quarter with only 2,671 vehicle shipments.

The next graph will show us how Ferrari's advantages hold up over time. Let's look at Return on Invested Capital (ROIC), a metric that gives investors a better understanding of how well a company is using its cash to generate returns. (The higher an ROIC figure, the better.)

RACE Return on Invested Capital (Annual) Chart

RACE Return on Invested Capital (Annual) data by YCharts.

As you can see, Ferrari is leaving mainstream and traditional luxury automakers in the dust when it comes to generating value with its capital. Furthermore, the fact that Ferrari's ROIC is increasing suggests its competitive advantages are actually becoming more powerful and valuable, rather than deteriorating.

Above the rules

Those two charts show that Ferrari, thanks to its competitive advantages, is wildly profitable compared to even some of the best competitors. But what's also intriguing is that it doesn't follow many of the auto industry's norms. While most automakers race to gain market share and increase sales annually, Ferrari doesn't play by the same rules. In fact, the company wants to limit its annual sales gains to retain its exclusivity and lucrative pricing power, as demand for its products always seems to exceed its supply.

The good news for investors is that despite keeping a lid on sales gains, management laid out a plan roughly a year ago that aims to double profit through 2022 by launching 15 vehicles, including the brand's first SUV. It believes it can do this without hindering its exclusivity, partly thanks to a growing wealthy class in China.

Another automotive industry rule that Ferrari ignores is the cyclical nature of vehicle sales. When a recession hits, consumers put off purchasing big-ticket items such as cars, and inevitably investors in major automakers tend to run for the hills. Ferrari, however, sells vehicles to consumers who aren't worried about recessions, and will buy the lucrative sports cars during economic downturns (or as the overall auto industry slows). Ferrari is simply unlike any other automaker, and that's partly why it trades at an eye-popping forward price-to-earnings estimate of 36.

Buy at the high?

Why do the fancy graphs matter? Why does not playing by auto industry rules make Ferrari a buy as the stock trades near all-time highs? As an investor, you want to buy and hold stocks long-term. And you want to choose companies with durable competitive advantages that will last. Ferrari has incredible advantages thanks to its exclusivity, pricing power, and racing brand image, and no matter how much competing automakers wish otherwise, they simply aren't turning into the next Ferrari.

A decade from now Ferrari will still have a wait list for its vehicles, and it will still be generating strong operating margins and ROIC. Ferrari will likely also be trading at a steep valuation because these qualities are rare, especially within the automotive industry.

Put simply: You can buy Ferrari near its all-time high because it has durable advantages that might put more distance between itself and its closest competitors down the road.