What happened

There's little question that the first half of 2022 was brutal for investors, ending with both the S&P 500 (^GSPC 0.17%) and the Nasdaq Composite Index (^IXIC 0.37%) in bear market territory. Yet even as the broader market slipped further on Friday, investors were beginning to cherry-pick companies that they believe will provide upside over the longer term, causing some stocks to buck the trend.

Against that declining backdrop, shares of Amazon (AMZN -0.68%) gained as much as 2.4%, MercadoLibre (MELI -0.17%) climbed as much as 4.6%, and Roku (ROKU -0.81%) surged as much as 5.3%. As of 12:42 p.m. ET, they were still trading higher, up 1.7%, 1.8%, and 2.2%, respectively.

So what

With the first half of 2022 in the rear-view mirror, many investors have been taking stock of their portfolios, and what they are seeing might at first glance seem distressing. The S&P 500 closed out June down 20% year to date, while the tech-heavy Nasdaq is down 30%. The combination of rampant inflation, lingering supply chain disruptions, and the war in Ukraine has resulted in widespread economic uncertainty.

That said, there are reasons to be optimistic. History buffs have noted that while this first half was the worst since 1970, even that example holds the reminder that things could turn on a dime. The stock market rebounded in the back half of 1970, surging 27% to result in a full-year gain. 

Technology stocks, including some streaming and e-commerce providers, have been among the hardest hit since the bear market carnage began. Amazon, MercadoLibre, and Roku haven't been immune -- they're down 42%, 66%, and 82%, respectively, from the highs they hit last year. 

Friday's gains by this trio suggest that some investors believe that the worst may be behind us, and while the volatility could continue for some time, the market is presenting patient investors with opportunities to pick up industry-leading companies at a discount.

Now what

There are valid reasons to believe that each of these companies could help lead the market higher in the coming months.

Amazon remains the undisputed leader in e-commerce and cloud computing, and the secular tailwinds provided by online retail and the digital transformation trend will no doubt resume once the economy regains its footing. Even as e-commerce sales took a hit in the first quarter, Amazon Web Services stepped in to pick up the slack -- that unit's net sales climbed 37% while its operating income jumped 57%. As pandemic-related comps ease in the second half of the year, e-commerce should resume its slow but relentless trek higher. 

MercadoLibre, which has been called the "Amazon of Latin America" generated remarkably strong results in Q1, suggesting that this e-commerce and fintech leader still has a long runway for growth ahead. Even in the face of an economic slowdown, its revenue grew 67% year over year, led by commerce revenue that climbed 44% and fintech revenue that soared 113%, even as the company remained profitable. These results show that the young e-commerce and fintech markets in Latin America still have plenty of room to expand, and will likely keep up their high growth rates for some time. 

Finally, Roku is the leading aggregator of streaming video services, another industry facing difficult comps. Yet even as streaming growth has slowed as the pandemic has waned, the secular tailwind driving viewers to streaming remains. Plans by Netflix and Disney to offer additional ad-supported streaming tiers are good news for Roku, as the majority of its revenue comes from digital advertising. While its first quarter revenue grew just 22% year over year, platform revenue -- from advertising, The Roku Channel, and Roku's connected-TV operating system -- climbed 39%. This suggests that when the supply chain disruptions weighing on its devices segment abate, Roku should resume its historic pace of growth. 

Even as inflation remains high and the possibility of a recession looms, some investors were tiptoeing back into the market Friday, looking for stocks that still have long-term growth potential -- and bidding up shares of Amazon, MercadoLibre, and Roku in the process.