October was a good month for the stock market. The S&P 500 rose 8% after earnings season didn't turned out to be as disastrous as investors and analysts had feared. One stock that did exceptionally well last month was DexCom (DXCM 1.89%), which soared by a whopping 50%. At around $120 per share, the stock hasn't been this high since April. 

Has DexCom's stock risen too sharply in value for it to still be a good buy right now, or can it continue rising and build off its recent gains?

A surge after its latest earnings report

On Oct. 27, DexCom released its third-quarter earnings results, which showed excellent growth and beat analyst expectations. After consecutive quarters of missing Wall Street estimates, the company reported adjusted earnings per share (EPS) of $0.28, which soundly exceeded analyst projections of $0.24.

DexCom, which is known for its continuous glucose monitoring (CGM) devices that help people with diabetes monitor their glucose levels, reported strong revenue growth of 18% for the period ended Sept. 30. Sales totaled $769.6 million as the company launched its new G7 device in five countries.

Although it isn't cleared for use in the U.S. just yet, CEO Kevin Sayer said on the company's earnings call that he expects the Food and Drug Administration to give it the green light before the year is over. DexCom also reiterated its guidance for the year, calling for revenue growth of between 18% and 19%, which would see its revenue come in at about $2.9 billion. 

The day after the release of the results, shares of DexCom jumped to more than $120, gaining 19% in just a single session. The stock was already gradually rising during the month, benefiting from the general recovery in the markets.

Has DexCom's stock become too expensive?

The biggest drawback of DexCom's stock is that it can appear to be trading at too hefty of a premium. In today's bear market, that can give investors an incentive to short it or simply steer clear of it and wait for a dip in the price.

In Q3, the company's unadjusted EPS was $0.24. If it were to maintain that pace for over a full year, its EPS would total $0.96. At the stock's current price tag, that would still put DexCom's price-to-earnings ratio at a whopping 125.

In terms of revenue, the stock's valuation has come down and it's not absurd when compared to other diabetes specialists:

DXCM PS Ratio Chart

DXCM PS Ratio data by YCharts

Is DexCom stock a buy today?

Investors have been accustomed to paying a premium for DexCom's stock simply because of its growth potential. Diabetes, unfortunately, is a growing problem in the world. In the U.S., close to 100 million people have pre-diabetes, which, without significant lifestyle changes, can eventually lead to diabetes. And according to the Centers for Disease Control and Prevention, up to 80% of people aren't aware they have the condition.

DexCom's CGMs can make life easier for people with diabetes, and that's why investors see significant value in the business over the long term. And so while the healthcare stock did surge last month, it's not at all-time highs and its valuation isn't obscene given where some other top diabetes stocks are trading.

As long as you're comfortable with buying and holding DexCom for years, this can still be a solid investment to buy today.