Stock prices can do irrational things from day to day, or even for a few years. But if you look at more extended periods, you'll see that the market is pretty good at sniffing out winning and losing companies. That's why The Motley Fool recommends long-term investing.

So, when a stock, say, The Trade Desk (TTD 0.46%), returns over 2,300% since its initial public offering in 2016, investors can feel like that company is genuinely worth looking at more closely.

The technology company has continued to grow in a lucrative but highly competitive advertising space. Despite its long-term performance, The Trade Desk is down over 40% from its high. Is the stock still a long-term winner?

Here is whether investors should consider adding the stock to their portfolios today.

Person touching digital marketing screen.

Image source: Getty Images.

An alternative to the "walled garden" dominance of big tech companies

Advertising has been around forever, and for a good reason: It works. But an age-old industry is evolving. Advertising dollars are steadily shifting from newspapers, magazines, and broadcast television to the internet, where your online footprint generates data that companies can use to target you with ads they think you'll respond to.

Google (Alphabet) and Facebook (Meta Platforms) built trillion-dollar businesses on this trend. They act as gatekeepers in internet search and social media, a $500 billion market between both segments. These companies operate walled garden ecosystems, meaning they make the rules, keep the data, and give little control to advertisers.

As big and powerful as these walled gardens are, there are other opportunities in the digital advertising market -- in connected TV, online video, websites, smartphone apps, mobile web browsers, and internet audio. That's where The Trade Desk has thrived.

Its technology platform enables companies to purchase ad space, target their ads to their ideal audience, and track the results of their ad campaigns. It also offers more transparency and control than these walled gardens, a big deal to advertisers, as evidenced by The Trade Desk's success over the years.

Why The Trade Desk could continue to grow profitably

Sustained, profitable business growth is the key ingredient for a winning long-term investment.

The Trade Desk has generated $2.57 billion in revenue over the past four quarters, converting $0.26 of every dollar into free cash flow. The company can continue to build on that. Gross ad spending on the platform was approximately $12 billion in 2024, just a fraction of an estimated $135 billion opportunity in digital media (excluding search and social apps).

Additionally, an estimated $300 billion is still spent on traditional media, which will continue to shift to digital over time. The Trade Desk's gross ad spending has grown by 24% to 25% annually from 2022 to 2024, so there aren't any signs of growth slowing down meaningfully.

TTD Revenue (TTM) Chart

TTD Revenue (TTM) data by YCharts.

The Trade Desk is currently transitioning customers to its new Kokai platform, which utilizes artificial intelligence to optimize ad spending, thereby helping drive better campaign results for customers and ultimately leading to improved monetization for The Trade Desk. That could mean higher profit margins over time.

Lastly, I don't think The Trade Desk gets enough credit for taking care of its shareholders. The company's discipline in managing stock-based compensation has limited share dilution to just 3.4% over the past five years. That's a big deal because a higher share count diminishes a stock's potential returns by spreading the company's profits across a broader shareholder base.

The recent sell-off offers investors an opportunity

Stocks with stellar long-term track records, like The Trade Desk, don't go on sale often. But that is precisely what's happened. A rare, disappointing quarter in fourth-quarter 2024 sent the stock tumbling from a valuation, as measured by enterprise value-to-revenue, that had grown increasingly hot over the past few years.

When you buy and hold a stock, you are, in a way, partnering with that company. You want to feel good about who is steering the ship. On the Q4 2024 earnings call, The Trade Desk's founder and CEO, Jeff Green, discussed 15 ways the company is capitalizing on industry growth trends. It's an encouraging glimpse into The Trade Desk's leadership.

Now, the stock is valued at a level rarely seen over the past six years.

TTD EV to Revenues Chart

TTD EV to Revenues data by YCharts. EV = enterprise value.

The Trade Desk seems poised to continue its ongoing trajectory of profitable growth moving forward. Its current price looks like a fantastic starting point for a fresh investment, as a lower valuation means that revenue and earnings growth will more likely reflect in the stock's returns.

Overall, it seems likely that The Trade Desk will continue to be a winning stock over the long term.