It was an ugly year for solar stocks in 2018. The Ardour Solar Energy Index, which tracks a dozen of the biggest global solar companies, fell almost 44% on the year, while the Invesco Solar ETF, a fund that owns a more diversified collection of solar companies, fell 26% last year, and lost more than 31% of its value from the peak in early summer. 

No segment of the solar industry was harder hit than solar cell and module makers. Of the half-dozen biggest "pure-play" solar cell and panel makers, five saw their stock prices fall more than 45% from their 2018 peaks, including First Solar (FSLR -1.46%), with a 45.5% drop from the peak in May, making it one of the better -- or maybe least worst -- performing solar panel stocks last year. 

Arial view of solar panel farm.

Image source: Getty Images.

But with easily the strongest balance sheet in the industry, an exclusion from solar tariffs for all of its panels, and expectations that 2019 will be a solid year for panel demand -- especially large-scale projects where First Solar typically does well -- is First Solar a buy? 

The short answer is yes, I think it is. But the slightly longer answer depends on how long you're willing to buy and hold your shares. If 2018 should have taught us anything about investing in solar panel makers, it's that things we can't reliably predict can change the short-term picture very quickly. 

Here's what happened for First Solar in 2018

What a crazy year we just ended. At the start of 2018, First Solar's stock has just rode a huge 110% gain in 2017 on the back of an incredibly successful year as customers lined up to order massive quantities of panels ahead of 2018's tariffs. 

And while its thin-film panels were excluded from the tariffs placed on silicon panels, this led to many investors baking in incredibly high expectations for the company's prospects for 2018 without considering the potential ramifications of 2017's orders taking a big bite out of order demand for 2018. 

Furthermore, almost nobody expected China to drop another massive hammer on the solar industry following the implementation of U.S. tariffs. But that's exactly what happened in June, when the country cut domestic incentives for both distributed (rooftop) solar and for utility-scale. 

FSLR Chart

FSLR data by YCharts.

When the biggest solar market in the world cuts incentives for domestic solar investment, you end up with a massive global oversupply of panels. Enter basic supply and demand: Prices fell sharply as a result. My Motley Fool colleague Travis Hoium recently reported panel prices were down more than 20% from the fourth quarter of 2017 to the third quarter of 2018 in the U.S. alone, even with a 30% import tariff on the majority.

Add it all up and even with a tariff exclusion, First Solar faced increased competitive pressure while also dealing with weaker demand through much of 2018, while its stock price started 2018 essentially priced for a big year. 

What to expect in 2019

The huge drop in prices is boosting demand for solar panels. Industry consulting expert Wood Mackenzie and the Solar Energy Industries Association upped their forecast for solar installations in the U.S. by 3.2 gigawatts from 2020 to 2023.

This was in large part because the combination of falling prices and continued manufacturing capacity expansion, which should keep prices low, has led to a number of major utility-scale projects getting the green light in recent months. Furthermore, U.S. import tariffs will start to roll off over the next several years, helping absorb some of the blow panel makers have taken over the past year. 

And while those long-term forecasts look good, the recovery isn't likely to happen quickly. Much of 2019's activity, at least on the utility side (where First Solar makes a living) has already been signed up. These projects don't get signed on a Friday and then installers show up Monday -- utility-scale projects take many months, sometimes years, to go from initial order to full implementation and revenue recognition. 

Furthermore, China's domestic incentives for distributed solar would likely need to be substantially raised to meaningfully improve upon most forecasts for panel demand. Less than a year after slashing those incentives, it's probably not a good idea to count on that happening. 

If you're looking long term, First Solar is a buy

Here's the thing: 2018 may have felt like a strange year, but unfortunately it's not atypical for the solar industry. This is a very dynamic space, and since a massive amount of global demand for new panels is driven by utility-scale projects, big cyclical swings in demand are par for the course. Factor in the impact of government incentives and those swings can exacerbated and made harder to predict. 

But First Solar is built to ride out those swings better than any panel maker. It finished its last-reported quarter with $2.7 billion in cash and investments, and will likely end 2019 with close to $2 billion after spending upwards of $750 million on capital expenditures to expand manufacturing capacity of its Series 6 panels. 

Those investments will almost certainly take multiple years to yield better results, and I think there's a decent chance the market loses patience and could even send First Solar's stock down this year, instead of viewing those cash expenditures as what they should prove to be: improvements in the company's ability to generate long-term profits. 

For investors thinking about the company and the solar market with a long-term view, First Solar looks like a buy. Shares trade for a reasonable 19 times 2019 earnings-per-share projections, and management continues to play the long game with business investments and maintaining a fortress of a balance sheet. 

The 2019 year may not prove to be a great one for First Solar or its stock. But unlike the start of 2018, it's not priced for perfection, and investors should do quite well if they buy now and hold for the long term.

Check out the latest First Solar earnings call transcript.