It's exciting to see a stock double in a year. But when such a large advance takes place, you need to step back and examine the reasons why. Sometimes the move makes complete sense and there's good reason to expect further gains. At the other extreme, however, investors sometimes get overly optimistic about stocks based on news that may or may not play out as everyone seems to hope. Here's where XPO Logistics, Inc. (XPO -1.27%), LGI Homes, Inc. (LGIH -2.34%), and NRG Energy, Inc. (NRG -3.16%) fall on this scale. 

This stock's driving forces are only getting stronger

Neha Chamaria (XPO Logistics): Logistics companies have gotten busier with the e-commerce boom, but no company appears to be benefiting as much as XPO Logistics.

XPO stock ended 2017 with a staggering 112% gain, leaving rivals FedEx and UPS in the dust. In Transport Topics' just released list of the top 50 logistics companies in North America, XPO has the No. 1 position in terms of net revenue. In 2017, XPO generated $15.38 billion in sales. XPO's solid foothold in the critical last-mile delivery space is the key to its success.

A man and a woman looking at a computer screen with a stock chart on it.

Image source: Getty Images.

XPO's rally wasn't a fluke, which is why the stock has continued its northward trend this year, as of this writing climbing another 14% year to date. With those gains, XPO looks steeply priced on a trailing price-to-earnings basis. But you'll still want to consider the stock if you weigh the growth potential in its cash flows.

You see, XPO generated record cash from operations (CFO) of nearly $799 million in the trailing 12 months. Yet the stock is trading at almost half its five-year average P/CFO ratio, or around 16.7. Here's an even more important number: Last quarter, XPO raised its cumulative free cash flow target for 2017 and 2018 to $1 billion. Given that the company generated FCF of $394 million in 2017, the number for this year should be bigger.

Considering that XPO signed 40 new customers in just the first quarter, there's no denying that the company is still growing at a torrid pace. Four factors are driving the company forward, and like any other growth stock that appears to be hitting on all cylinders, XPO shares should continue to enjoy a premium.

A cyclical trend to invest in 

Jason Hall (LGI Homes, Inc): Texas-based LGI Homes saw its stock price surge an incredible 161% in 2017. But with a market cap of just over $1.5 billion at recent prices, and annual sales still shy of $1.3 billion, this small, but fast-growing homebuilder deserves a place in investors' portfolios. 

To start, the company's focus on entry-level homes is allowing it to benefit from the strong trend of millennials entering the housing market in full force and the serious undersupply of starter homes to meet anticipated demand in coming years. This has resulted in incredible growth for LGI. Last quarter, it closed on 62% more homes year over year, and delivered earnings-per-share growth of 53% for the quarter and 51% for the full year. 

But with total home sales of 5,845 in 2017, LGI makes up a tiny portion of the U.S. housing market:

US New Single Family Houses Sold Chart

US New Single Family Houses Sold data by YCharts.

We have only recently started to see new home sales approach historical levels. And with substantial pent-up demand after years of underbuilding, LGI is one of the best-positioned homebuilders to profit from the coming millennial housing boom. Even with rising interest rates, mortgages are still incredibly cheap on a historical basis, so I don't expect this to keep millennials out of the housing market. 

Finally, I think LGI is reasonably priced, trading for around 11 times 2018 earnings estimates and under 15 times trailing-12-month earnings. It could be a volatile stock since housing can be very cyclical. But long-term investors looking to capitalize from a multiyear trend could do very well with this small homebuilder. 

After a big run, NRG Energy's future is uncertain at best

Reuben Gregg Brewer (NRG Energy, Inc.): NRG Energy's stock rose an incredible 130% in 2017. In the month of July alone, the utility company's shares rocketed higher by more than 40%! The main reason for all of the excitement was a massive business shift that has really started to play out this year with the completion of a major asset sale in early 2018.

Under previous leadership, NRG Energy was betting big on a renewable power future. In fact, it helped to start the so-called yieldco craze with NRG Yield, Inc. The problem for NRG Energy was leverage, with long-term debt increasing from around $8 billion to over $20 billion between 2012 and 2015 to back former CEO David Crane's renewable power bet. Following Crane's departure in late 2015, NRG Energy began a review of its business. In mid-2017, the utility decided its future was to reduce its renewable drive so it could refocus on being a more traditional utility.   

Investors applauded the move (that was the impetus for the July price spike), with assets sales set to help bring down the company's leverage. The early 2018 sale of its sponsorship stake in NRG Yield and other renewable assets was a pivotal transaction, generating nearly $3 billion in cash and removing around $7 billion in debt from the balance sheet. In fact, after peaking at more than $20 billion, the company's long-term debt should be down to around $10 billion after this latest deal. But that's still a notable amount of leverage, given that the business is smaller now, too.

NRG Total Long Term Debt (Quarterly) Chart

NRG Total Long Term Debt (Quarterly) data by YCharts.

At the end of the day, NRG's big run in 2017 was driven by news of its turnaround plans. That's fine, but now it has to prove that it can deliver on those plans. Until it does, the highly leveraged NRG Energy is not a buy for most investors.

Two to consider, one to avoid

Huge stock advances take place for all kinds of reasons. In the case of XPO, the company is executing well in a highly competitive industry that is benefiting from the growth of online retail. LGI, meanwhile, is doing a great job of serving an underserved housing segment that demographically looks likely to keep growing in the years ahead. Both of these stocks are worth a deep dive since there are no signs of these positive trends -- and the stocks' outstanding performances -- coming to an end. 

However, all stock gains aren't the same. For NRG Energy, the company's advance was driven by a major business shift that is only just starting to play out. Although investors are clearly excited by the change, the heavily indebted utility needs to prove it's heading in the right direction. Until it does, most investors are better off on the sidelines after such a big run.