Many investors are likely wary of buying stocks after the market's dismal performance in 2022. Inflation, rising interest rates, and other macro headwinds battered the market and deflated many high-growth stocks which had soared in 2020 and 2021.

But historically speaking, investors usually net the biggest gains by buying stocks when they're down during bear markets. I believe a modest $3,000 investment in these three tech stocks -- Meta Platforms (META 1.54%), Oracle (ORCL -2.25%), and Magnite (MGNI 0.70%) -- when the chips are down could pave the way toward some healthy gains in 2023 and beyond.

A smiling person works on a laptop computer in a home setting.

Image source: Getty Images.

1. Meta Platforms

Meta, once known as Facebook, lost more than half its value over the past 12 months as investors fretted over the slowing growth of its advertising business and its obsession with the unprofitable metaverse. Meta's ad sales were throttled by Apple's privacy changes on iOS, stiff competition from ByteDance's TikTok, and the broader slowdown of the advertising market amid the persistent macroeconomic headwinds. Meanwhile, Meta's Reality Labs segment, which houses its virtual reality devices and software, continued to burn billions of dollars but failed to attract more mainstream users.

Analysts expect Meta's revenue and earnings to drop 1% and 34%, respectively, in 2022 as its ad sales stall out and its costs keep rising. But Meta is also taking steps to stop that bleeding.

It's adjusting its algorithms to gather more first-party data for its targeted ads. It's also expanding Instagram Reels to counter TikTok, and it laid off 13% of its workforce last November to cut costs. Meta's turnaround could be slow, but its stock also looks cheap at 17 times forward earnings. With 3.71 billion people using at least one of its apps (Facebook, Messenger, Instagram, and WhatsApp) monthly, Meta isn't going anywhere, and it could bounce back over the next few years.

2. Oracle

Oracle, the world's largest provider of database software and hardware, was once considered an aging tech giant which generated anemic growth. But that all changed over the past few years as it transformed its on-premise software into cloud-based services. It also locked in customers with additional enterprise-resource planning tools.

Oracle accelerated that transformation with big acquisitions, including NetSuite in 2016 and Cerner in 2022, but it still generated enough cash to buy back more than a third of its outstanding shares over the past five years. During that same period, Oracle's stock rose 73% and generated a total return of 87% after including its reinvested dividends.

Analysts expect Oracle's revenue, which includes its inorganic gains from Cerner, to rise 18% in fiscal 2023, which ends this May, as its adjusted earnings stay roughly flat. Next year, they expect its revenue and earnings to grow 8% and 13%, respectively, after it laps its acquisition of Cerner.

Those are solid growth rates for a stock that trades at 18 times forward earnings. Oracle's stock probably won't generate multibagger gains, but it's a great safe haven play that will benefit from the secular growth of the cloud market.

3. Magnite

Magnite, which was created by the merger of The Rubicon Project and Telaria in 2020, is the world's largest independent sell-side platform (SSP) for digital ads. SSPs help publishers manage and sell their own ad inventories, and they shouldn't be confused with demand-side platforms (DSPs), like The Trade Desk, which actually sell the advertising space.

After its initial merger, Magnite expanded by acquiring SpotX, SpringServe, and Carbon to expand its connected TV (CTV) and publisher-monetization capabilities. Those acquisitions significantly inflated its reported revenue and altered some of its key growth metrics, but its "pro forma ex-TAC" (excluding traffic acquisition costs) numbers smooth out those differences.

Magnite believes it can grow its pro forma ex-TAC revenue at an average rate of 25% over the next few years as its adjusted earnings before interest, taxes, depreciation, and amortization (EBITDA) margins remain between 35% to 40%. Like The Trade Desk, Magnite expects most of its long-term growth to be driven by the ongoing expansion of the CTV advertising market, which should continue to grow as linear TV platforms (like cable and satellite TV) fade away.

Analysts expect Magnite's reported revenue to rise 23% in 2022 as its adjusted EBITDA increases by 20%. Its growth could cool off in 2023 as the macro headwinds impact its ad sales, but its stock still looks incredibly cheap at just 2 times next year's sales and 7 times its adjusted EBITDA. By comparison, The Trade Desk -- which is also a great long-term play on the CTV market -- trades at 12 times next year's sales and 31 times its adjusted EBITDA.