Apple shares gained almost 5% Wednesday, following the release of its earnings report Tuesday, with the company's current share price hovering around $210.

If you invested in Apple 10 years ago, that decision would have paid off. According to CNBC calculations, a $1,000 investment made on May 1, 2009, would be worth more than $13,000 as of midday May 1, 2019, for a total return of more than 1,200%.

Over the same period, the S&P 500 returned just over 300%.

And, thanks to trade-ins, lower prices on iPhones, and improved trade talks between the United States and China, some analysts seemed optimistic about the company's stock overall.

"We believe Apple has locked up strong share of the premium tier market and will continue to dominate high-end smartphones sales and capture the vast majority of smartphone profits for the next several years," according to financial services firm Canaccord Genuity.

CNBC: Apple stock as of May 1, 2019.

Still, while Apple's stock has ticked up recently and done mostly well over the years, any individual stock can over- or underperform and past returns do not predict future results. And even though the company reported earnings of $2.46 per share for its most recent quarter, beating estimates by 10 cents a share, it saw its second consecutive overall quarterly revenue decline.

Apple is looking outside of smartphones to increase sales. Chief Executive Officer Tim Cook underlined two growing businesses during his call with analysts: Apple Services, which includes things like Apple Music and iCloud, and Apple Wearables, which includes AirPods and the Apple Watch.

"It was our best quarter ever for services, with revenue reaching $11.5 billion," Cook said. Services revenue was up 16% from $9.19 billion in sales from a year earlier.

If you're looking to get into investing, seasoned investors such as Warren Buffett suggest you start with index funds, which hold every stock in an index, meaning they're automatically diversified and tend to be low cost. Plus, because they fluctuate with the market, they're typically less risky than picking individual stocks.

Here's a snapshot of how the markets look now.

Like this story? Subscribe to CNBC Make It on YouTube!

Don't miss: If you invested $1,000 in Microsoft in 2009, here's how much you'd have now