What happened

The first half of 2022 was one for the record books, with both the S&P 500 and Nasdaq Composite closing it out in bear market territory. Yet even as the broader market indexes lost ground in June, investors were looking for bargains and cherry-pick stocks that they believed offered upside in the coming years, causing some stocks -- particularly tech -- to buck the broader market trend.

With that as a backdrop, shares of Snowflake (SNOW 3.65%) and Okta (OKTA -0.61%) each gained 8.9% in June, while Atlassian (TEAM -9.23%) climbed 5.7%, bucking the flagging market.

So what

With the first half of 2022 over, market participants are beginning to take stock of their holdings, and the results are mostly abysmal. The S&P 500 and Nasdaq Composite each lost more than 8% last month, compounding losses that total 21% and 30%, respectively, so far this year. Consumers are battling inflation that hit 40-year highs of 8.6% in June, while economic uncertainty born of supply chain disruptions and the war in Europe adds to investor angst.

Still, there are reasons for optimism. Market historians note that while the market performance during the first half of the year was its worst in more than 50 years, it's always darkest before the dawn. In 1970 -- the last time the market performed this badly -- the S&P 500 plunged 21% in the first half, only to rebound 27% in the last six months, and posting a gain for the full year. 

Technology stocks have been among those hardest hit this year, with the tech-centric Nasdaq leading the bear market declines. Atlassian, Snowflake, and Okta have all fallen victim to that trend, with the stocks down 55%, 62%, and 63%, respectively, from last year's highs.

However, these companies bucked the overall market trend in June and gained ground, suggesting investors believe that in some cases, the selling has gone too far and there are bargains to be had, particularly for those with patience and a long-term investing time horizon.

Now what

Even as uncertainty remains, there are reasons to believe that operational and financial metrics could drive these companies higher in the future.

Atlassian remains an industry leader in workflow management, being named to Gartner's Magic Quadrant for Enterprise Agile Planning Tools in 2022 for the fifth time. The company's Jira service management platform was recognized as a Customers' Choice from Gartner's annual Peer Insights survey. Atlassian's results reflect its growing popularity. Revenue from its fiscal third quarter (ended March 31) grew 30% year over year.

Recurring subscription revenue grew 59%, while its cloud revenue grew 60%, illustrating the large and growing demand for its cloud-based solutions. While Atlassian isn't yet profitable, it is producing strong free cash flow, which suggests its losses are the result of non-cash items including depreciation. 

Okta is acknowledged by Gartner as an industry leader for Access Management, as is its recent acquisition Auth0. This leadership is echoed by the company's fiscal 2023 first-quarter results (ended April 30), as revenue grew 65% year over year, while subscription revenue increased 66%. Okta's future prospects are bright, as evidenced by its current remaining performance obligation (RPO) -- sales not yet booked as revenue -- which jumped 57%. While Okta isn't yet profitable, it's also free cash flow positive. 

Gartner identified Snowflake as a leader in Cloud Database Management Systems. Its fiscal Q1 2023 (ended April 30) revenue grew 84% year over year, while its RPO surged 82%. Existing customers consistently spend more each year, as evidenced by its net revenue retention rate of 174%. Snowflake is not profitable, but generated strong and positive free cash flow. 

Inflation remains unchecked and the potential for a recession looms. But investors seem content to shop for best-of-breed bargains amid the tech sector's ongoing rout, and are buying up shares of Snowflake, Okta, and Atlassian in the process.