Last year was painful for many investors. All the major U.S. indexes were down in 2018, with the S&P 500 (^GSPC 0.87%) falling more than 6% for the year. Not all stocks fell victim to the downturn, however, with programmatic advertising specialist The Trade Desk (TTD 0.70%) soaring more than 150% -- and that may be just the beginning.

Even after those impressive gains, I think the company is on the verge of a once-in-a-generation opportunity that will propel its stock to new heights. Let's take a look at what The Trade Desk does, that opportunity ahead, and why I think the company is well positioned to prosper in 2019 and beyond.

Check out the latest The Trade Desk earnings call transcript.

A woman silhouetted standing on a hill with her arms raised, her body replacing the number one in 2019.

Image source: Getty Images.

Programmatic advertising

The Trade Desk specializes in the digital ad space, and more specifically programmatic advertising. This may not be a household term, but is easy enough to understand. The process involves using high-speed computers and sophisticated algorithms that automate the process of ad buying in real time. This method ensures that the ads are matched with the customers they are most suited for. The Trade Desk is able to place more than 9 million ads per second in an online auction that is much more cost effective and efficient for advertisers. This cutting-edge technology puts The Trade Desk in a unique position to benefit from a growing and lucrative trend.

Total global advertising revenue is expected to be about $700 billion in 2018, and could top $1 trillion within the next 10 years. The adoption of digital ads continues to rise, now accounting for about half of that total. Programmatic advertising is one of the fastest-growing segments of the market, and is expected to have grown by 21% year over year in 2018 versus 2017.

The Trade Desk is taking market share from the incumbents, with revenue that climbed 54% year over year during the first nine months of 2018 -- more than twice as fast as programmatic ad sales grew industry-wide. This wasn't a fluke, either, as The Trade Desk overcame tough comps to grow its ad sales by 52% in 2017 and 78% in 2016.

The Trade Desk has a market cap of less than $6 billion. It went public just over two years ago and is already profitable. Diluted earnings per share of $1.07 grew 39% year over year during the first nine months of 2018 compared to the year-earlier period.

David takes on Goliath

It isn't any secret that the digital advertising space is competitive, and the biggest players dwarf The Trade Desk by comparison. Facebook (META 0.14%) and Google, a division of Alphabet (GOOGL 1.42%) (GOOG 1.43%), are a virtual duopoly in the realm of digital advertising. While estimates vary, the tech giants accounted for about 58% of the market in 2018. Those two have also been credited with nabbing a majority of the growth in the segment in recent years.

While Facebook and Google are formidable challengers, The Trade Desk now has an edge over them that requires a little context.

Businessman looking through a window shaped like a climbing graph.

Image source: Getty Images.

The ripple effect of data scandals

The European Union recently enacted sweeping data-privacy rules known as the General Data Protection Regulation, which is designed to legalize the data protections and privacy rights of its citizens. One of the unintended consequences of privacy scandals like Cambridge Analytica and these far-reaching new laws was an announcement by Google in mid-2017 that it would stop sharing DoubleClick IDs, which show how many times a person has seen a specific ad on a particular device, with advertisers. According to The Trade Desk CEO Jeff Green: "Removing the ID makes comparative reporting go away, so this is a very big deal...Taking this away weakens the value proposition of YouTube, Google, and DBM (DoubleClick Bid Manager)." 

"Because The Trade Desk does not transact indirectly identifiable consumer data and because we don't own a search engine, we can provide a Unified Open ID that enables advertisers to compare every destination on their media plan to every other destination objectively," Green said in a recent conference call. "Our data and the data of our third-party partners cannot be directly associated with an individual. Data in The Trade Desk platform does not include names, phone numbers, or Social Security numbers, for example." 

This gives The Trade Desk a distinct advantage over its much larger competitors, and is allowing it to continue to steal market share.

Why Trade Desk is my top 2019 pick

There's certainly no guarantee that The Trade Desk will capitalize on this massive opportunity, but the company's recent results are encouraging, and growth in some of its key channels is surging. The programmatic advertiser has been tapping into larger trends, like the shift from linear television to streaming video and the growing dominance of mobile. Ads on its internet-connected-TV segment soared, growing 10-fold year over year, while the audio segment climbed 192%. The mobile video and in-app segments also posted impressive gains, up 98% and 90%, respectively, year over year.

These numbers illustrate how the company is taking advantage of these societal trends for even further gains. Add its state-of-the-art technology to the equation, and it's easy to see why The Trade Desk is my top stock for 2019.