Last year was one that Wall Street would rather soon forget. However, after enduring the worst stock market performance in more than a decade, investors finally have reason to be optimistic. The S&P 500 has climbed 25% from its bear market low (as of this writing) and sits less than 6% below its all-time high. Once the index surpasses that level, it will mark the final criteria signaling the arrival of the next bull market.

What makes the recent rally unique is how unequal it has been. Many stocks are still struggling to gather momentum, while the so-called "Magnificent Seven" stocks (listed below in alphabetical order) have run circles around the broader market so far this year:

  • Alphabet -- Up 51%
  • Amazon (AMZN 3.43%) -- Up 72%
  • Apple -- Up 44%
  • Meta Platforms -- Up 180%
  • Microsoft -- Up 54%
  • Nvidia (NVDA 6.18%) -- Up 240%
  • Tesla -- Up 93%

Despite being among the top gainers of 2023, two of these tech stocks still have plenty of potential upside and could gain 58% and 122%, respectively, over the coming 12 to 18 months, according to analysts.

A person staring at graphs and charts on a computer monitor.

Image source: Getty Images.

Magnificent Seven buy No. 1: Amazon -- 58% implied upside

Part of the attraction of Amazon is the diversification investors can get from just one stock. The company has established itself as the undisputed leader in e-commerce and cloud computing, yet never stops innovating. Amazon is also a force to be reckoned with in digital advertising, streaming video, artificial intelligence (AI), video game streaming (via Twitch), consumer electronics, and more. This host of opportunities could help drive Amazon stock to new highs.

The elephant in the room, of course, is the state of the economy, but the recent cooling of inflation and the potential for interest rate cuts next year are encouraging. As the leading digital retailer, Amazon will no doubt benefit from the inevitable rise in consumer spending. So far this year, the company captured approximately 38% of all e-commerce transactions in the U.S. -- more than the next 14 online retailers combined, according to online data provider Statista.

There's also the significant opportunity afforded by the accelerating adoption of cloud computing and AI, where Amazon also has a big advantage. In the face of rising competition, Amazon Web Services (AWS) continues to maintain its position as the leading provider of cloud infrastructure services, with 30% of the market, according to cloud data provider Canalys. Recent demand for generative AI could spur additional growth, as AWS offers expanded AI services to its cloud customers.

Despite its already impressive performance, Redburn analyst Alex Haissl is still remarkably bullish on Amazon, maintaining a buy rating on the stock and raising the price target to $230, implying an additional upside of 58%. Haissl believes investors are underestimating how quickly Amazon's growth will reaccelerate, arguing "the outlook for Amazon is exceptional."

The analyst isn't the only one still bullish on Amazon. Of the 53 analysts that issued an opinion in October, 51 rated the stock a buy or strong buy, and not one recommended selling.

There's another reason to buy Amazon stock now. Despite its recent run-up, the stock is selling for just 2 times next year's sales. While it's not the screaming buy it was just months ago, the stock is still priced near its lowest valuation since 2016. This represents a compelling opportunity to load up on Amazon stock and hold for years, if not decades.

Magnificent Seven buy No. 2: Nvidia -- 122% implied upside

There's a solid argument that the strong and growing demand for generative AI has helped fuel the market rally this year, and the clear and undisputed winner of this trend has been Nvidia. The company's graphics processing units (GPUs) were already the gold standard for AI processing, but the release of the next-generation H200 Hopper chip just days ago cemented Nvidia's AI credentials. The new AI superchip delivers "nearly double the capacity and 2.4x more bandwidth" compared to its predecessor, the A100.

Nvidia's recent results help illustrate the surge in demand for all things AI. For its fiscal 2024 second quarter (ended July 30), Nvidia delivered record revenue of $13.5 billion, which soared 101% year over year, while its diluted earnings per share (EPS) of $2.48 surged 854%. Data center revenue, which includes processors used for AI, jumped 171%, spurred on by the rapid adoption of generative AI.

Management is forecasting another record quarter, guiding for revenue of $16 billion, an increase of 317% year over year, driven by soaring adoption of AI.

Despite the stock's gains of 244% so far this year, Rosenblatt analyst Hans Mosesmann believes there's more to come. The analyst maintained his buy rating on Nvidia, boosting his firm's price target to $1,100, suggesting the stock could more than double from here. The analyst cited the company's triple-digit year-over-year revenue growth last quarter -- and a similar forecast for the current quarter -- calling it "unprecedented." Furthermore, with an installed base estimated at $1 trillion, the data center market is in the midst of a paradigm shift to support high-performance computing and generative AI, giving Nvidia a long runway for growth ahead.

The analyst isn't alone in his enthusiasm. Of the 53 analysts who issued opinions on Nvidia in October, 50 rated it a buy or strong buy, and none recommended selling.

Nvidia's valuation is a sticking point for some investors and that's certainly understandable. The stock is selling for 45 times forward earnings and 15 times forward sales (as of this writing), but its valuation can't be viewed in a vacuum. Nvidia's triple-digit earnings growth caused its price-to-earnings ratio to contract by half after its last report, illustrating why it's deserving of a premium. Yet, a similar performance in the current quarter will further reduce its valuation. The AI revolution has only just begun, giving Nvidia powerful secular tailwinds to drive its future growth.