The "Magnificent Seven" stocks dominated in 2023 -- all outperforming the S&P 500 by a wide margin. The term was coined by Bank of America analyst Michael Hartnett to describe seven large tech-focused companies: Apple (AAPL 1.76%), Microsoft (MSFT -0.25%), Amazon, Alphabet, Meta Platforms, Nvidia, and Tesla (TSLA 2.03%).

Each company has its own pros and cons. But one thing is certain among them all. They've all gotten a lot more expensive after this year's run-up, so it's time to be selective in 2024. Valuations matter, and there's only so much an investor should pay for a company's future earnings.

With that in mind, here's why Tesla, Apple, and Microsoft are the only three Magnificent Seven stocks I would consider buying next year.

A person typing at a computer.

Image source: Getty Images.

Tesla is focused on production volumes, even at the expense of its margins

Out of all the Magnificent Seven stocks, Tesla is down the most from its all-time high. And for good reason.

AAPL Chart

AAPL data by YCharts

The company is not at the top of its game from a growth or profitability perspective. It's also unclear if Tesla will remain the undisputed leader in electric vehicles a decade from now, especially as so many companies are trying to take market share.

And unlike companies like Nvidia and Microsoft that directly benefit from artificial intelligence (AI), Tesla has moonshots that simply haven't materialized.

The history of Tesla is riddled with starkly contrasting opinions on whether it is grossly overvalued or is the greatest company ever. And there's a good chance that its future will also face breakout potential or a lot of room to collapse. But what I like about Tesla is that it has a good setup for 2024 and beyond. There are specific things to look for that could support or take away from the investment thesis.

In the short term, Tesla needs to prove it can fund its long-term growth plans even during a downturn in the business cycle. Tesla's long-term success depends on increasing production, achieving massive scale, and then unlocking pricing power to make vehicles more efficiently than the competition, and therefore, win on quality and quantity. It already has this advantage now. But to preserve it, Tesla will need to build more factories and manage its extremely complex supply chain.

In the longer term, Tesla will need to monetize its AI and robotics investments. If it makes a leap in self-driving, it could open the door to the coveted robotaxi market, which could completely reimagine ride-sharing and deliveries.

The company's decision to slash prices and take a hit to its margins to focus on volume looks bad now. But it could end up being a brilliant move if it discourages other automakers from ramping up EV spending, leaving Tesla to extend its lead over the competition. After all, if Tesla shows it has immense pricing power and can afford to undercut the competition, that may deter companies from going toe-to-toe with Tesla at the risk of losing billions in the process.

In this vein, there's a path for Tesla to either sustain its production growth, recover its margins, or both in 2024. If that happens, the stock could do very well next year. But even if Tesla's performance stalls in the near term, it still has so much potential upside that simply can't be ignored. Even more than margin or volume improvements, investors should monitor Tesla's self-driving progress in 2024.

Apple's buybacks prevent its valuation from getting too expensive

Apple stands out as the "safest" Magnificent Seven stock. It has the best valuation, especially considering the company's relentless stock repurchase program. Buybacks decrease the outstanding share count, boost earnings per share, and make the stock a better value even if it doesn't grow earnings organically.

Apple is also conservative with its spending. It doesn't chase growth just for the sake of it. Instead, it has a purposeful product development pipeline. So if the market does sell off or valuations compress across industries, then Apple will be in an excellent position to deploy some of its cash on a timely acquisition.

Apple is unique because it can thrive when the economy is doing well and consumer spending is high. But it also has a nice margin of error in case things take a turn for the worse.

Apple has a 31.5 price-to-earnings (P/E) ratio compared to 33.3 for the Invesco QQQ Trust, which mirrors the performance of the 100 largest Nasdaq stocks. Apple is a higher-quality company than the rest of the Nasdaq 100, even with lower growth. And for that reason, it looks like a good value heading into 2024.

Microsoft is using its suite of products and services as a sounding board for AI

Like Tesla, Microsoft has a clear setup for 2024. At just about every investor event or presentation this year, Microsoft would make sure you knew just how much it was investing in AI and how big of an opportunity it was. Even if the rhetoric is over the top at times, Microsoft is correct in that it has its finger on the pulse of the consumer and business community. It is implementing AI across its products and services. And because it can monitor the reception of these updates, it can see what is and isn't working and then make adjustments.

Microsoft is a straightforward and easy-to-understand AI play. In many ways, its solutions are nothing groundbreaking. One example is Microsoft Copilot, which act as an assistant in an application to make it easier to use and let the user accomplish tasks faster.

The company generates tons of free cash flow, has an impeccable balance sheet, and can fund both near-term and long-term AI investments with the wiggle room to take risks and make mistakes. Microsoft has a balanced risk/reward profile when it comes to investing in AI.

A word of caution about the Magnificent Seven

Understanding the market's attitude toward a theme or industry at a given time can help you make wise investment decisions.

It wasn't long ago, just last year in fact, that many investors wanted nothing to do with Amazon because of its slowing growth and overspending. Or with Alphabet, because the only good use of its cash seemed to be buybacks. Or with Tesla, because consumer spending was crashing in the wake of higher interest rates and EV competition was getting more ruthless.

Meta Platforms was left for dead after the market thought Instagram was losing market share and the company was wasting money on the Metaverse. Even Nvidia crashed as investors thought the cyclical slowdown would damage the growth trajectory. Microsoft and Apple held up better last year, but mostly because they have lower valuations and wider moats.

This is all to say that sentiment can change in an instant. And that's exactly what happened in 2023.

Anything can happen in 2024. As it stands now, there are only three Magnificent Seven stocks that look like good buys. But if there's a major market sell-off or a prolonged bear market, all seven companies are worth a closer look.

The secret lies in finding which ones you like the best and having the conviction to step in and buy those stocks, even when the market wants nothing to do with them.