Over the past three years, the stock market has gained about 36%, but it remains virtually unchanged so far this year. Volatility has become the norm as big moves take the Dow Jones Industrial Average and the S&P 500 on a roller coaster ride.

Yet in 2018, there are two stocks that would have taken a $1,000 investment on Jan. 1 and turned it into more than $8,000 in less than six months. Let's see why NII Holdings (NASDAQ:NIHD) and Tandem Diabetes Care (NASDAQ:TNDM) have rocketed higher this year.

TNDM Chart

TNDM data by YCharts.

NII Holdings (up 713%)

It would have taken a big leap of faith to invest in Latin America's Nextel wireless service provider NII Holdings at the start of the year. For one thing, it was trading as a penny stock at the end of 2017, going for less than $0.50 per share, burning through its cash, and with significant debt.

Its business was a mess for years as the world moved on to 3G and 4G networks and it was still offering only 2G service. In 2014, it filed for bankruptcy, and emerged the following year, having shed over $4 billion worth of debt. The devaluation of Brazil's real weighed heavily on its finances, though, as it sold off operations in Argentina, Mexico, Chile, and Peru leaving Brazil as its only market. The company only launched a 4G network in 2017, but by then it faced a lot of competitors.

Its finances were once again a disaster and it was also in danger of losing its Nasdaq market listing, though that risk is now seemingly past.

So what caused its stock to suddenly reverse course and zoom to such outrageous gains? It seems Brazil's National Telecommunications Agency will consider raising the cap on how much spectrum that telecoms can own, which might allow NII Holdings to sell off assets or be acquired. It's hired an advisor to sell its remaining 70% stake in Nextel Brazil, having previously sold a 30% position in order to raise $50 million. There was an option by the buyer to increase its stake to 60% for an additional $150 million, but the owner chose not to exercise it, and instead sold its 30% stake to another buyer for $70 million. 

During the company's conference call with analysts to discuss NII's earnings, CFO Dan Freiman said: "When enacted, these changes and our better operational performance may open up new opportunities for us to unlock the value of our assets. We will proactively explore alternatives as the process evolves." The company expects the regulatory process to be completed by the third or fourth quarter of 2018.

While there's been some financial improvement following a restructuring of its debt, there's no real reason to invest in NII Holdings. It was a precariously positioned company beforehand. And whatever benefits it may enjoy should this regulatory change come through have likely already been priced into the stock.

Just because a stock has done well doesn't mean you should feel like you've missed out. A blind squirrel can still stumble on an acorn. Betting on a penny stock like NII Holdings would have been exactly that: gambling. And that's not the way you should invest your money.

Tandem Diabetes Care (up 859%)

Investors would have done much better keeping an eye on Tandem Diabetes Care, a small, promising -- yet still risky -- medical products company that is growing sales, but also losing money. In the first quarter, it sold a few thousand of its next-generation insulin pump, the t:slim X2, and says it needs an installed base of 80,000 pumps to break even on a cash flow basis, though it believes it can hit that milestone some time next year.  

Because diabetes is a huge growth market, with the incidence of the disease expected to grow 165% in the U.S. by 2050, Tandem has a promising technology that analysts believe, if successful, could challenge Medtronic (NYSE:MDT) for industry leadership. Medtronic offers a competing technology called a continuous glucose monitor (CGM) that tracks a patient's blood sugar over time to let them better manage their disease.

As diabetics seek alternatives to insulin injections to regulate their condition, Tandem has partnered with DexCom to bring its insulin pump system (that works with DexCom's monitoring system) to market early next year. The artificial pancreas monitors patients' blood glucose levels and uses an algorithm to know when to deliver an appropriate dose of insulin. At least one analyst thinks highly of Tandem's prospects for being able to grab market share when its system is commercialized. He upgraded the stock, which sent shares soaring.

Although Medtronic is many times larger than Tandem, its CGM device is also much larger than Tandem's t:slim X2, and thus more cumbersome. And DexCom's monitors, which work with both systems, can be used for longer periods of time with Tandem's pump, making them more convenient. Also, the need for finger pricks for dosing decisions isn't needed with the t:slim X2 whereas they're still necessary with Medtronic's MiniMed system.

While the potential for Tandem Diabetes Care may be more promising than for NII Holdings, it also is a risky proposition. Even though the FDA just approved Tandem's pump with its newest technology that predicts where insulin level needs and adjusts production accordingly, Medtronic also received regulatory approval for its own enhanced CGM system that now allows for treating patients between ages seven and 13.

It removes a competitive advantage Tandem had with its pump being able to be used on those as young as six. Tandem's finances are probably not going to look pretty either for awhile yet. Still, by the t:slim X2 getting approved for use with DexCom's more feature-rich monitoring technology, a development that wasn't expected, there's good reason why Tandem Diabetes Care shares are soaring.

Pull back the lens

While the run-up experienced by both companies this year has been extraordinary, it's becoming more clear that only one of them is really worth considering. That's what happens when you take risks with your investments, especially with penny stocks.

Although both NII Holdings and Tandem Diabetes Care have destroyed shareholder value over the past three years, each losing around 80% of their value, which actually includes their amazing gains this year, only Tandem has the potential to become a profitable long-term investment. 

Rich Duprey has no position in any of the stocks mentioned. The Motley Fool owns shares of Medtronic. The Motley Fool has a disclosure policy.