Many tech stocks have fallen hard in the past few months. For instance, shares of Palantir Technologies (PLTR 3.19%) and Roku (ROKU 5.41%) currently trade at 38% and 32%, respectively, below their all-time highs. But, in both cases, Wall Street's pessimism appears to be based on short-term headwinds, and that creates an opportunity for long-term investors.

Specifically, Roku and Palantir should benefit from unstoppable trends in the coming years, and, with both stocks currently trading at a discount, now looks like a good time to add a few shares to your portfolio. 

Adult works with multiple papers and a laptop in front of them at home.

Image source: Getty Images

1. Palantir

Palantir specializes in big data. The company got its start working with U.S. intelligence agencies like the CIA, and its Gotham software helped special forces locate Osama bin Laden. Since then, Palantir has won contracts with numerous government organizations, including the U.S. Air Force, Army, and the U.S. Coast Guard, as well as the National Nuclear Security Administration and the U.S. Department of Health and Human Services.

However, the company's portfolio also includes Foundry, a data analytics platform designed for commercial clients. This software helps pharmaceutical companies accelerate drug discovery, it enables financial institutions to detect and prevent fraud, and it allows industrial companies to effectively manage supply chains and monitor manufacturing quality. Current customers include Sanofi (SNY 1.15%), Airbus (EADSY 1.32%), and Ferrari (RACE 3.53%), as well as various banks and hedge funds.

During the most recent quarter, Palantir boosted its revenue from government customers by 66% to $232.1 million, but commercial sales grew just 28% to $143.5 million. That discrepancy has investors worried about Palantir's future prospects in the commercial sector. But while it's certainly smart to keep an eye on these figures, there are two reasons I'm not concerned, at least not yet.

First, Palantir increased its commercial customers by 61% in the first half of 2021. And while clients typically generate very little revenue during the acquisition phase, spend tends to increase over time, meaning commercial sales could very well accelerate in the coming quarters. Also, Palantir's Foundry for Builders program — which seeks to win new commercial clients during the start-up phase — should reinforce that dynamic over the long term.

Second, Palantir puts its market opportunity at $119 billion, comprising $56 billion and $63 billion in the commercial and government sectors, respectively. In other words, government clients actually represent the bigger addressable market, and Palantir developed its Gotham platform before Foundry. With that in mind, I'm not surprised to see government spend growing more quickly right now.

Looking ahead, as more organizations (both public and private) seek to harness the power of big data, Palantir should see strong demand for its software. That's why this growth stock looks unstoppable.

2. Roku

Roku has become a key player in the streaming industry. Its platform connects users with content publishers, allowing viewers to access virtually any streaming service. And, as the only purpose-built operating system for connected TV (CTV), Roku has established itself as the industry leader, powering 31% of global streaming time in the second quarter of 2021.

Even so, the stock has trended downward in recent months, driven by slowing growth in the wake of the COVID-19 pandemic. Specifically, streaming hours rose just 19% in the most recent quarter, a significant deceleration from the 65%  growth posted in the prior year. However, investors need to contextualize that figure. Over the same period, streaming time across all platforms dropped 2% in the U.S., meaning Roku actually crushed the industry average.

Why does that matter? It implies a highly engaged user base, and that makes Roku's platform valuable to advertisers. To reinforce that advantage, the company is adding original content for its own ad-supported service, The Roku Channel, and so far the results are promising. After debuting 30 original series in May, The Roku Channel saw record streaming in the two weeks that followed, which translated into a strong financial performance.

During the second quarter, active accounts jumped 28% to 55.1 million, monetized video ad impressions more than doubled, and revenue surged 81% to $645 million. Roku also posted a positive GAAP profit of $0.52 per diluted share.

More importantly, I think the company can maintain that momentum over the long term. This year, 17% of U.S. TV ad spend will go to CTV platforms, up from 13% in 2020, evidencing the growing popularity of streaming entertainment. To capitalize on that opportunity, management is executing on a strong growth strategy.

For instance, Roku recently launched an app on the Shopify (SHOP 4.90%) App Marketplace, making it easy for merchants to create targeted ad campaigns on the Roku platform. To add, Roku is also working with Lionsgate (LGF-A 4.50%) (LGF-B 4.96%) to produce its first original movie, and it has other original content in the pipeline, with plans to release a total of 75 original series in 2021. For all of these reasons, this growth stock looks unstoppable.