No one can predict what the stock market, or any individual stock, will do in 2024. The stock market surged in 2023, which was probably not on many investors' bingo cards in January. But one thing investors can do is avoid investments where the odds are stacked against them. Paying too high a price for even the best company can lead to subpar results.

Two stocks that look far too expensive going into 2024 are Nvidia (NVDA 6.18%) and Apple (AAPL -0.35%).

Nvidia

Nvidia is the leader of artificial intelligence. The company's data center GPUs are selling faster than they can be made. Training advanced large language models, like those that power ChatGPT, requires incredible computational horsepower. Nvidia's proprietary CUDA compute platform has been around since 2007, pairing with its world-class hardware to create a competitive advantage that has been difficult for anyone to overcome so far.

While Nvidia may appear untouchable, its days of absolute dominance won't last. If estimates for how big the AI accelerator market will become are close to accurate, there will be mammoth incentives for the tech industry to ensure that there are options beyond Nvidia. AMD expects the market for AI chips to grow nearly tenfold by 2027 to $400 billion. Nvidia's market share is almost certain to shrink as alternatives balloon, and as buyers of AI accelerators optimize for total cost of ownership.

Nvidia's growth has been incredible in 2023, and its profits have soared even faster than revenue. The company's profit margins are the highest they've ever been. But the shortage of AI chips won't last forever as competitors race to bring alternatives to market, and neither will the gold rush mentality surrounding AI. Nvidia's software advantage will be chipped away, although that process may take a while.

Nvidia is valued at around $1.22 trillion. That's about 40 times the average analyst estimate for earnings. That valuation doesn't seem unreasonable at first glance, but you must be willing to assume that Nvidia's incredible profit margins and growth rate will persist.

What if they don't? What if the companies spending big to train large language models find that turning those models into sustainable businesses is tougher than expected? What if competing chips from AMD, Intel, and others provide viable alternatives to Nvidia's pricey products? Taking current growth rates and extrapolating out years is a dangerous thing to do, especially in a very new market. ChatGPT, which kicked off the AI frenzy, has only existed for about a year.

If there's any sign that Nvidia is running into trouble in 2024, the stock has a long way to fall.

Apple

What's Apple's growth story? After a big surge during the pandemic's height, revenue has essentially stagnated in the post-pandemic period. Revenue slipped 1% year over year in the fiscal fourth quarter, which ended on Sept. 30, and an import ban on the Apple Watch isn't going to help matters.

The iPhone still represents more than half of Apple's revenue, and it's hard to imagine the smartphone market being a major source of growth for the company in the long run. Refresh cycles have been stretching out, and each year's models offer minimal improvements. The iPhone is an incredible business for Apple, but it's no longer a growth engine for the company.

The services business generated $85 billion of revenue during fiscal 2023, but growth was sluggish. Services revenue rose by about 9%, not enough to offset slumping sales of iPhones, Macs, iPads, and wearables. While earnings per share edged up for the year thanks to share buybacks, net income declined slightly.

The big problem for Apple stock is its valuation. The company's market capitalization now tops $3 trillion, putting the price-to-earnings ratio above 30. Given Apple's anemic growth and the lack of a clear catalyst that could accelerate growth, that valuation seems high. The company's Vision Pro headset is its next big swing, but a $3,499 price tag will be tough for customers to swallow.

Apple stock has soared nearly 50% in 2023, but don't expect a repeat in 2024.