Oil prices have burned off 30% since July in the face of a strong dollar and a flood of supply from the U.S. shale boom. But the energy sector’s four-month-long downtrend appears to be over. Both fundamental and technical evidence suggests that the worst of the correction has passed. It’s time to be bullish on the most oversold sector relative to the S&P.

The onslaught of selling in mid-October suggests the last of the sellers have been wiped out.

“Based on the intensity of down volume (selling) relative to up volume (buying), the energy sector hit capitulation levels in mid-October not seen since the 2002 low,” Stephen Suttmeier and Jue Xiong, analysts at Bank of America Merrill Lynch wrote in a note Nov. 11.  “Downside volume capitulation off key support suggests that the worst is over for the sector. Energy is poised to build a base and head higher.”

The energy sector appears to have found buying support at their 2011 high and an uptrend line starting from early 2009. Sentiment, as tracked by Market Vane’s Bullish Consensus, and momentum, as tracked by Relative Strength Indicators, have both reached multi-year extremes from which upswings have taken place, Suttmeier and Xiong added.

BofA Merrill’s analysis concludes long-term development would require brent crude oil to trade at $100 long term. Oil producers in the Eagle Ford, Bakken and Permian require oil prices of $50 to $70 per barrel to achieve a reasonable 15% return on new investment, which means producers are are still profitable at current oil prices in the mid 70s.

Integrated oil companies continue to downsize and restructure operations, which should lift earnings analysts say.

“Production growth has been difficult, but we think project start-ups and natural gas and LNG growth, particularly in Asia, will drive growth over the next five years,” Stewart Glickman, an analyst at S&P Capital IQ wrote in a report Nov. 15.

Global oil demand should rise by 900,000 barrels per day in 2014 to 92.6 million barrels per day, he added citing data from the International Energy Agency. The IEA projects global demand to rise by 1.2 MMb/d to 93.8 MMb/d next year.

The energy sector is undervalued compared to the stock market overall. The flagship Energy Select Sector SPDR ETF (XLE) has a price-to-earnings ratio of 14.7 vs. nearly 18 for the SPDR S&P 500 ETF (SPY). XLE trades at 1.8 times book and 1 times sales,  a discount to the S&P’s price-to-book ratio of 2.5 and price-to-sales ratio of 1.7.  XLE’s foreign counterpart, SPDR S&P International Energy Sector ETF (IPW) trades at only 12 times forward earnings, 1.3 times book and merely 0.6 times sales while yielding 4%, according to Morningstar.

Cheap valuations provides fertile ground for mergers and acquisitions as seen this week in Halliburton’s (HAL) announced takeover of Baker Hughes (BHI). If the union of the second- and third-largest oil services companies makes sense, then so would a combination of their smaller peers.

The biggest names in XLE have been very aggressive in buying back shares this year, which in turn boosts earnings per share and creates a floor of demand. In the third quarter, Exxon (XOM) -- the largest holding in XLE -- bought back $3 billion of shares. It plans to buy back another $3 billion of its stock in fourth quarter. Chevron (CVX) repurchased $1.25 billion of its stock in third quarter in an existing $1.25 billion-per-quarter share repurchase program.  A share repurchase program kicked off in July 2010, allows Chevron to buy back $500 million to $2 million of its shares quarterly. The company’s 10-Q released Nov. 11 states its buyback program has no set term of monetary limits. Schlumberger’s (SLB) board approved a $10 billion buyback program in July 2013. Over the first nine months of this year, it has repurchased $3.5 billion in shares.

Philip J. DeAngelo, is the owner and managing director of Focused Wealth Management, an SEC registered investment advisor, with $420 million in assets under management in Highland, N.Y.