While it's tough to argue that most of the "Magnificent Seven" stocks would be bad long-term investments, there are two in particular that I'd be eager to buy right now. Amazon.com (AMZN -1.61%) is trading at just 2% below its all-time high, but its profitability is still in the relatively early stages.

The other is Alphabet (GOOGL 0.23%) (GOOG 0.23%), the parent company of Google. Alphabet actually just reached a fresh all-time high as I'm writing this (on May 16), and its recent results gave investors a lot to smile about.

Here's a rundown of why I'd buy both of them right now (I already own Amazon) despite the strong recent performance.

Amazon's business has been impressive recently

Amazon is a company that doesn't need much of an introduction, with a dominant share of the U.S. e-commerce market and the leading cloud services business (AWS). Long-term investors have been handsomely rewarded for their patience, but the company could still have lots of room to grow on both sides.

On the e-commerce side of the business, Amazon.com is the clear leader, with a larger e-commerce market share in the United States than its next 10 competitors combined. But e-commerce only makes up about 15% of U.S. retail sales today, and even lower percentages in some of the other markets where the company operates. And while Amazon Web Services (AWS) is the cloud services leader, the global cloud computing market is about $500 billion in size as of 2023 but is expected to grow to five times that level by 2032.

Not only does Amazon still have a ton of growth potential, but CEO Andy Jassy's plans to improve efficiency are starting to pay off. In the most recent quarter, Amazon's operating income more than tripled year over year, driven by especially strong growth in AWS as well as advertising revenue, both of which are high-margin businesses.

An absolute cash machine with room to grow

Unlike Amazon, Alphabet is already a massively profitable business. Its main subsidiary, Google, owns some of the most dominant platforms and applications in the world, including the massive Google Search business, YouTube, Gmail, Chrome, Android, and much more. It also has the Google Cloud business, which is a direct competitor to AWS.

While some of Google's businesses are quite mature, there's still a lot of room to optimize its advertising business, which is the primary way its non-Cloud businesses make most of their money. And we've already mentioned the massive growth potential of cloud services over the next decade.

One thing to realize is that all of Google's businesses have incredible margins. Over the past four quarters, Alphabet has produced a 26% net margin. In 2023, Alphabet generated net income of nearly $74 billion, and the company has about $108 billion in cash and short-term investments on its balance sheet. So not only does the company have plenty of financial flexibility to capitalize on opportunities, but it returns tons of capital to shareholders through buybacks, and it just declared its first-ever dividend.

An all-time high doesn't mean the same thing as "expensive"

To be sure, these aren't cheap stocks. Alphabet trades for roughly 30 times forward earnings expectations, and Amazon's P/E is significantly higher. Combined, they have market caps in excess of $4 trillion.

However, one important concept for investors to know is that a high price doesn't necessarily mean a stock is expensive. These are two proven winners with lots of future growth potential, and I wouldn't be surprised if both produced market-beating returns for years to come.