The Trade Desk (TTD 1.38%) has been a star, delivering a mind-blowing 480% return to investors over the last five years. It benefited from the rise of digital advertising and should continue to do so for the foreseeable future.

But for those who missed the boat, should they buy the stock today to ride the megatrend? Let's explore that further in this article.

A frustrated employee looking intently at a laptop screen.

Image source: Getty Images.

The Trade Desk delivered some solid numbers lately

Thanks to the global lockdowns, technology companies had a great time during the pandemic. But as economies reopened, these companies suffered as the expectation of higher normalized growth did not materialize. Leading companies like Amazon and Meta Platform had to downsize their operations in the last few quarters to adjust to the new reality.

But for The Trade Desk, it's pretty much business as usual. In the second quarter of 2023, revenue grew 23% to $464 million, and the bottom line turned around from a loss of $19 million to a net profit of $33 million. Adjusted earnings before interest, taxes, depreciation, and amortization (EBITDA) surged 39% to $180 million.

In addition, the company added some big names, such as Warner Bros. Discovery and Walmart, to its list of partners. It also ended the quarter with $1.4 billion in cash and cash equivalents, short-term investments, and zero debt.

Overall, The Trade Desk delivered solid results despite a generally weak macroenvironment. Its solid cash balance also allows the company to capitalize on future growth opportunities (more in the next section).

The Trade Desk's prospects in the next few years

The Trade Desk executed  well over the last few years, growing revenue by 412% from $308 million in 2018 to $1.6 billion in 2022.

While there are many reasons for the company's solid performance, its focus on helping its customers succeed is the critical ingredient for success. By providing customers with an easily accessible data-driven digital advertising platform, the tech company helps advertisers reach more audiences effectively and efficiently across multiple channels. The result is that customers get better outcomes with less effort and at a lower advertising budget.

On top of that, The Trade Desk is riding on a massive tailwind of digital advertising, including the digitalization of traditional channels. Also, the continued movement toward connected TV is another enormous opportunity for the company to leverage. For perspective, The Trade Desk estimates the total addressable market for global ad spending is $830 billion. In other words, the company can continue to benefit from these megatrends in the coming years.

In short, The Trade Desk's growth prospects will remain bright in the coming years. It just needs to ensure that advertisers continue to succeed on its platform and innovate to capture new opportunities in digital advertising. I think it has a decent shot at achieving both.

Is The Trade Desk's stock cheap?

As of this writing, the stock trades at price-to-sales (P/S) and price-to-earnings (P/E) ratios of 25 and 84. Comparatively, Alphabet's  stock trades at P/S and P/E ratios of 6 and 29, respectively.

While it is not unusual for The Trade Desk's stock to trade at a premium given its substantial growth prospects, investors must consider whether it warrants such a steep premium. After all, Alphabet is one of the best tech companies in the world and owns a fabulous digital advertising business.

Is The Trade Desk's stock a buy?

The Trade Desk executed at a world-class level in the last few years and is positioned to keep its momentum riding on the megatrends in digital advertising.

Yet, it's not a buy. Its steep valuation provides no margin of safety for investors. Still, existing investors may consider holding onto the stock as long as they are willing to accept its high valuation, since the company's prospects remain bright.