Baytex Energy Corp. (TSX:BTE)(NYSE:BTE) has been on the slide for more than three months, and investors who missed the big rally in the first half of the year are wondering if this is a good opportunity to buy the stock.

Let’s take a look at the beleaguered oil producer to see if it deserves to be in your portfolio.

Rocky ride

The meltdown in the oil sector still has investors looking at their computer screens in awe.

In just over two years, many of the former top picks in the patch have gone from promising growth stories to bankruptcy candidates. In the case of Baytex, the stock went from $48 in June 2014 to below $2 earlier this year.

The rebound in oil prices helped rescue the stock from near death in January, and nimble investors who bought at the lows briefly saw the shares soar above $8 in June.

Now, the stock is back down to $5, and investors are wondering if they should buy, hold, or sell.

The numbers

Baytex generated Q2 funds from operations of (FFO) of $81.3 million. That’s down nearly 50% from the same period last year.

Lower prices were a big reason for the slide, but reduced production due to a drop in development expenditures also hit the numbers. Output in Q2 2016 was just 70,031 barrels of oil equivalent per day (boe/d) compared to about 84,812 boe/d in the same period last year.

Baytex is still sitting on significant debt and has much less room in its credit facilities to help it ride out another downturn in oil.

Net debt at the end of Q2 was $1.94 billion, which is significant given the company’s market capitalization of roughly $1 billion. None of the long-term debt is due in the near term, so the company does have some time to hope for better prices.

I think investors should focus more on the credit facilities, which were reduced as a part of the new agreement with creditors. Baytex has US$575,000 (CAD$760 million) in available credit. About 45% of the available funds had already been drawn at the end of June.

Outlook

On the positive side, Baytex is doing a good job of keeping expenditures in line with revenue. The company’s capital program for the first half of the year was $117 million, and FFO came in at $127 million. As long as oil can hold in its recent trading range, Baytex should be able to keep its head above water.

However, Baytex continues to reduce its development program, and this is a concern. The company only had three drilling rigs in operation when it reported Q2 results, as compared to six in the first quarter. This will result in even lower production, and the company now expects output of 67,000-69,000 boe/d in 2016 compared to the previous guidance of 68,000-72,000 boe/d.

What’s the bottom line?

Oil has to move higher to enable a boost to capital expenditures and stop the downward spiral in in output.

Should you buy?

Baytex remains a risky bet. The company has limited liquidity, and another drop in oil prices would probably put heavy pressure on the stock.

If you believe oil is on the cusp of a sustainable rally, Baytex might be worthy of a small contrarian bet. Otherwise, I would look elsewhere for investment opportunities.

Stock buy alert hits astounding 96% success rate!

The hand-picked investing team inside Stock Advisor Canada recently issued a buy alert for one special type of "bread-and-butter" stock where The Motley Fool U.S. has banked profits on 23 out of 24 recommendations. Frankly, with an astounding 96% success rate that has delivered average returns of 260%, chances are this new pick could deliver life-changing returns as well. Because the team at Stock Advisor Canada fully embraces the same time-tested investing philosophies that have led to countless Motley Fool winners globally. So simply click here to unlock the full details behind this new recommendation and join Stock Advisor Canada.

*96% accuracy includes restaurant stock recommendations from Motley Fool U.S. services Stock Advisor, Rule Breakers, Hidden Gems, Income Investor and Inside Value since each services inception. Returns as of 5/27/16.

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Andrew Walker has no position in any stocks mentioned.