The S&P 500 slipped 9% in the second half of 2023, dragged down by mixed signals about the strength of the economy and uncertainty surrounding Fed monetary policy. That backslide leaves the benchmark index 13% below its all-time high, but Wall Street sees a rebound on the horizon.

The S&P 500 bears a 12-month price target of 5,082, which implies 22% upside from its current level. That bottom-up estimate combines the median price target estimate on every stock in the index, aggregating 11,270 individual analyst ratings, according to FactSet.

Should that forecast come to fruition, the S&P 500 would reach a record high sometime in the next year. But should those gains fail to materialize, investors would still do well to view the drawdown as a buying opportunity. The S&P 500 has always recovered its losses in the past, and there is no reason that should change.

Here's why Amazon (AMZN 3.43%) and The Trade Desk (TTD 1.67%) are worth buying now.

1. Amazon

Amazon operates the most-visited e-commerce marketplace in the world, and will account for nearly 39% of online retail sales in Western Europe and North America this year. The company fortified its leadership with an expansive logistics network that supports fulfillment services for merchants and rapid delivery for buyers. Indeed, Amazon  consistently set the bar for fast shipping.

Success in retail has given rise to a booming advertising business. Amazon accounts for 75% of U.S. retail media spending -- more than 10 times its closest competitor -- and it recently became the third-largest ad tech company in the world. In a bid to accelerate growth, Amazon will bring ads to its Prime Video streaming service next year.

Switching gears, Amazon Web Services (AWS) is the market leader in cloud infrastructure and platform services, and its market share rivals that of Microsoft Azure and Alphabet's Google Cloud combined. Leadership in cloud computing means AWS is uniquely positioned to benefit from growing demand for artificial intelligence.

Amazon looked sharp in the third quarter. Revenue increased 13% to $143 billion on particularly strong growth in retail and advertising, and GAAP net income more than tripled to reach $9.9 billion as the company continued to focus on cost control. Investors should expect a similar growth trajectory in the future.

Retail e-commerce sales are projected to increase at 8% annually through 2030, while the cloud computing and ad tech markets are expected to increase at 14% annually during the same period. That points to low-double-digit revenue growth for Amazon through the end of the decade, which makes its current valuation of 2.5 times sales look cheap. Investors should not hesitate to buy a position in this remarkable growth stock today.

2. The Trade Desk

The Trade Desk operates the largest independent demand-side platform in the advertising industry. Its software leans on artificial intelligence (AI) to help media buyers plan, measure, and optimize data-driven campaigns across digital channels like desktop, mobile, and connected TV. The Trade Desk is a fraction the size of market leader Alphabet, but it has distinguished itself in a few key ways.

As an independent ad tech company -- meaning it does not own any media content -- The Trade Desk does not compete against its own customers. Alphabet, on the other hand, simultaneously works with third-party ad buyers and sellers, and it sells its own ad inventory from YouTube and Google Search. While undeniably effective, that business model is riddled with conflicts of interest that have landed Alphabet in hot water with regulators.

Building on that, The Trade Desk says its platform packs superior AI and the industry's most advanced data marketplace. Both features help media buyers measure and fine-tune campaigns in way that would be impossible on other platforms. Those claims are subjective (and audacious), but they are rooted in truth: Brands are more willing to share data with a non-competitor like The Trade Desk, and data is the cornerstone of AI.

The Trade Desk delivered impressive financial results in the second quarter. Revenue increased 23% to $464 million, topping the 3% ad revenue growth Alphabet achieved in the same period. The company also reported GAAP net income of $33 million, up from a loss of $33 million a year earlier. CEO Jeff Green offered the following insight on the earnings call: "Our relative outperformance over the last few quarters means we have gained more market share than in any other period in our company's history."

Going forward, Grand View Research expects the ad tech market to compound at 14% annually through 2030, but The Trade Desk should beat the average given its strong competitive position. Morningstar anticipates annual revenue growth of 22% over the next five years. In that context, its current valuation of 20 times sales seem reasonable, and it's certainly a discount to the three-year average of 29.2 times sales.

Investors should feel comfortable buying this growth stock today, though it would be prudent to start with a small position and add shares gradually.