Baytex Energy Corp. (TSX:BTE)(NYSE:BTE) has been on a bit of a roller-coaster ride this year, and investors are wondering if the latest pullback is an opportunity to buy.

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

Tough run

Baytex’s troubles are well known, and the stock’s fall from glory is one of the ugliest in the Canadian energy patch.

What happened?

Back in June 2014 Baytex traded for $48 per share and raised its monthly dividend of $0.24 per share. The company had just closed a large deal in the coveted Eagle Ford shale play and thought cash flow was about to rise significantly.

The optimism seemed justified given the fact that WTI oil traded for US$100 per barrel. Unfortunately, things haven’t worked out as planned.

By late January of this year, oil was less than US$30 per barrel, the dividend was history, and investors were screaming at their monitors as the stock plunged below $2 per share.

The subsequent rebound in crude prices helped keep the company alive, and the stock surged above $8.50 in June, but has been on the slide ever since and is now testing $5 again.

To say the name is volatile is probably an understatement, and things might not get any better in the near term.

Production issues

Baytex is in a tough situation. The company is carrying too much debt, and its access to credit was restricted as part of renegotiations with creditors.

This is putting a pinch on its ability to boost capital expenditures and increase production.

As a result, output is falling, and that isn’t going to get any better unless oil prices improve materially.

How much does Baytex owe?

At the end of Q2 2016, Baytex reported long-term debt of of $1.54 billion. That’s a lot for a company with a market capitalization of $1.05 billion. Most of the long-term notes aren’t due for quite some time, so that part is manageable as long as the company can make interest payments.

However, the company finished the second quarter with roughly 45% of its available US$575 million in credit facilities used up, so there isn’t a lot of flexibility if oil decides to plunge back below US$40 per barrel.

Baytex only had three rigs operating in Q2, which is down from six in the first quarter.

As a result, output came in at just 70,031 barrels of oil equivalents per day (boe/d) compared to nearly 85,000 boe/d in Q2 2015.

The company is selling some assets, which will contribute to a further slide in output, and said full-year 2016 production will be 67,000-69,000 boe/d.

Oil outlook

Oil’s 2016 rally has been primarily driven by rumours that OPEC will agree to a production cut. In fact, the group is expected to announce a concrete agreement at its November 30 meeting.

The market has bought the hype for most of the year, but there is a big risk the deal won’t materialize, and even if one is announced, many analysts believe it won’t be honoured.

Why?

Iraq, OPEC’s second-largest producer, wants to be exempt from the deal. So does Iran. This pretty much leaves Saudi Arabia on its own to do the heavy lifting, and that is unlikely to happen, given that the Saudis and Iran are supporting opposite sides in two wars.

On top of this, there would have to be some kind of buy-in from non-OPEC members, such as Russia, to have a significant impact on the market. Russia also has significant military expenditures right now and is currently producing oil at record levels.

So, investors should be careful about betting on a rise in oil prices over the medium term.

Is Baytex a buy?

At this point, you have to believe oil is definitely headed higher to own this stock. That’s a brave call to make. If the OPEC deal falls apart, oil could easily slide back below US$40, and Baytex would likely take a big hit as a result.

There is certainly strong upside potential in this name under the right conditions, and I think Baytex will eventually be bought out, but the stock still looks too risky today for my taste.

Investors should probably look for other contrarian 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.