Baytex Energy Corp. (TSX:BTE)(NYSE:BTE) has been one of the poorest-performing names in its peer group over the past six months, and, despite the fact its most recent quarter was surprisingly positive, the market completely overlooked it.

Baytex reported a number of positive developments. Despite an average WTI oil price of about US$41.58 year-to-date, Baytex generated year-to-date free cash flow of $42 million. The company further reduced its debt load, upped its production guidance, and lowered its capital costs.

There is good reason to believe that peak pessimism has been reached with Baytex. The company is currently trading at about $5 per share with oil around $45 per barrel, and the company trades at a massive 15% discount to its peer group on an enterprise-value-to-debt-adjusted-cash flow basis. A sustained lower share price for Baytex would require unreasonably low oil prices in 2017, or a weaker than expected production outlook at current prices. Both are unlikely.

2017 oil prices are unlikely to average lower than US$45 per barrel

The single most important factor for Baytex is oil prices. Oil is currently trading around US$45 per barrel, and a further sell-off in Baytex would require a larger move down in oil prices. While such a move is possible over the short term—especially considering there is a chance OPEC could come to no agreement at the end of November—what truly matters for Baytex is where oil prices will average over the next year.

It is difficult to see a scenario where oil prices average under $45 for the year. Canada’s banks see oil prices averaging between $54 and $60 for the year, and this is a sensible range. Despite the pessimism around the oil market now, it is important to remember that the global liquids market was oversupplied by an average of two million barrels per day in 2015. In September 2016, this had dwindled down to 80,000 barrels per day.

At the same time, the U.S. crude inventories that the market is so often concerned about have been on a steady decline and are only 31.7 million barrels above where they were last year. This figure was over 120 million barrels in August.

With many refineries currently shut down for maintenance, this is a seasonally weak period for oil. Regardless of what happens with OPEC (they are limited in how much they can raise production since most countries are near capacity), the market is set to continue this re-balancing process into 2017.

Concerns about Baytex’s falling production are overblown

Due to the fact that about 35% of Baytex’s production comes from its Canadian heavy oil segment, there are concerns that Baytex could see its production decline should oil prices not average above $50 per barrel.

Baytex has indicated it would require $50 oil before it re-starts drilling in Canada, and, as a result, this production will decline as wells exhaust themselves and aren’t replaced. This would take down Baytex’s overall production. These concerns are largely overblown.

Despite oil being in the mid-$40s currently, Baytex actually just upped its production guidance for the year from 67-69 thousand barrels per day to 69-70 thousand barrels per day. This is because Baytex decided in the most recent quarter to increase the number of rigs on its Eagle Ford asset base from two to three last quarter to four currently.

Baytex has stated it needs about four rigs to keep production in the Eagle Ford flat, and this implies that, at current pricing levels, Baytex would likely be able to maintain 65% of its production base.

While it is true that should oil prices average only $45 for the year that Canadian production would decline, Baytex just re-instated 7,500 barrels per day of Canadian production that it had shut down due to low oil prices. It estimates it wouldn’t need to shut down production again unless oil dropped below $40, and this shut down was a major source of weak Canadian production this year.

With Baytex decreasing its Eagle Ford capital costs from $8.2 million per well to $5.2 million per well in the previous quarter, further cost reductions could mean more production from the Eagle Ford to offset weakening Canadian growth.

The end result is that even in the weak scenario of $45 for 2017, Baytex is likely to see little production deterioration and little cause for a further sell-off.

Baytex is a buy at current prices for investors with a long-term outlook.

At the Motley Fool, we have an even better buy signal to consider

Over the course of The Motley Fool U.S.'s 23-year history, this rare buy "signal" has generated impressive wealth for those that have been smart enough to pay attention to it. It's so rare, that it's happened less than two dozen times... but when it does... it's made investors extremely profitable. If you're interested in knowing the stock behind this rare buy "signal" - and you're excited to take advantage of this golden opportunity, then you're going to want to read this. Click here to unlock all the details behind this new recommendation from Stock Advisor Canada.

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 Adam Mancini has no position in any stocks mentioned.