Tesla and Apple have absolutely obliterated the market's measly 5% gain this year. Shares of the electric car company have soared more than 300%, and the iPhone maker's stock is up about 60% year to date. While Tesla has proven to be the better investment of the two, long-term shareholders in both companies are likely thrilled with their performance.

For instance, a $2,000 investment at the beginning of the year in the two companies, split equally between each, would now be worth $5,790.

Company

Investment on 12/31/2020*

Market Value Today

Return

Tesla (TSLA 12.06%)

$1,000

$4,180

318%

Apple (AAPL 1.27%)

$1,000

$1,610

61%

Total

$2,000

$5,790

190%

*Implies an investment has been made using fractional shares so that the investor could have invested exactly $1,000 in each stock. Data source: Author calculations based on stock returns as of Sep. 9, 2020.

While this past performance is great, most investors are likely more concerned with the two stocks' future potential. Are these hot stocks still buys after their monstrous moves higher this year?

Let's take a look.

A person looking at charts on a laptop.

Image source: Getty Images.

Apple stock: Buy, sell, or hold?

After trading at a conservative price-to-earnings ratio between about 13 and 20 for most of the last decade, the tech company has finally convinced investors it deserves a high-flying valuation. Today, the tech stock commands a price-to-earnings ratio of 36, putting it in the company of Microsoft and Facebook -- two other megacap tech stocks that have regularly garnered P/Es around this level in recent years.

While it's tempting to call this the top for Apple since the company doesn't normally trade at such a high valuation, investors should realize that the tech giant has arguably earned this premium price tag of late. Apple's fast-growing services segment is growing as a percentage of revenue, and its installed base of active devices is becoming increasingly important to operating results. Investors are thus now acknowledging that the tech company has built a more durable, predictable, reliable, and diversified business. Even more, Apple managed to pull this off while maintaining a robust iPhone business.

While Apple's market capitalization of more than $2 trillion may seem difficult to justify on the surface, keep in mind that the tech giant raked in $72 billion in free cash flow over the past 12 months. While this free cash flow will probably move both up and down year to year, it's arguably more likely to rise steadily over the long haul than decline. A strong services segment that represents about a third of Apple's total gross profit, continued growth opportunities in wearables, and a loyal base of customers that will support product revenue growth for years to come will all drive this rise.

So is Apple stock a buy today? For the investor willing to hold the stock for the long haul (around 10 years or more), I believe shares remain attractive. Of course, investors should mind the risks. These include basic risks of the unknown, including the broader market risk associated with buying any individual stock. In addition, it's always possible that Apple's competitive advantages -- namely its loyal customer base, pricing power, and high switching costs for customers with multiple Apple products -- could erode as competition heats up. If investors see this trend play out, they may need to rethink their bullish stance on the tech giant.

Tesla stock: Buy, sell, or hold?

Electric car company Tesla has similarly earned its keep. The automaker has demonstrated a step change in the pace of its business execution recently, including the rapid completion of a factory in China, a Model Y launch that came six months ahead of Tesla's initial schedule for the new vehicle, better-than-expected profitability, and impressive progress on the construction of factories in Berlin and Austin. 

Model S interior.

Tesla Model S. Image source: The Motley Fool.

Tesla's growth opportunities are equally important in making a bull case for the stock. First, with only 500,000 deliveries expected this year, the automaker is barely touching the surface of a global auto market that ships around 90 million new cars annually (less in 2020, of course, because of the pandemic's impact on the auto industry). In addition, Tesla believes its energy business in battery storage and solar power will eventually grow to rival its auto business. Finally, there's the speculative, but still notable, potential of the company's autonomous driving capabilities. These developments could yield a self-driving ridesharing network and much higher pricing for the company's Autopilot software.

But here's where investors should exercise extreme caution: The stock could be overvalued. The company currently has a market capitalization of about $325 billion, even though Tesla's free cash flow over the trailing 12 months was approximately only $800 million. For Tesla to justify its current valuation, therefore, it's going to need to continue growing revenue rapidly while also achieving significant operating leverage, which will, in turn, boost its bottom line and free cash flow significantly.

While there's always a chance that the stock will prove to be a bargain in hindsight, Tesla shares have become more of a speculative investment at this level than a stock an investor can rationally call undervalued.

For these reasons, the automaker's stock looks like more of a hold than a buy today.