The energy sector has been the worst performing segment of the market and remains in the negative this year as depressed crude oil prices pressured energy producers.

However, with crude price stabilizing, the energy sector and related exchange traded funds are finally returning to positive trend.

The Energy Select Sector SPDR (NYSEArca: XLE), the largest equity-based ETF, has gained 10% since its mid-August lows and is now trading at 2.2% above its long-term simple moving average.

With earnings season quickly upon us, the recovering oil prices may help support revenue and earnings growth in the energy sector. According to FactSet data, energy companies int he S&P 500 Index is expected to reveal a 17% year-over-year revenue growth and 108% year-over-year earnings growth, with all segments of the sector expected to report strong earnings except oil and gas equipment and services.

Supporting the improved outlook for the energy sector,  crude oil prices have stabilized. West Texas Intermediate crude oil futures now trade around $51.0 per barrel while Brent crude futures are hovering around $56.6 per barrel.

After the Organization of Petroleum Exporting Countries and non-OPEC members like Russia convened in May, major global oil producers agreed to extend their 1.8 million barrel per day supply cut until March 2018. The oil cartel is even hinting at more ways to support price cuts, even calling on the upstart U.S. shale industry to do their part as well. U.S. shale producers have been a thorn in the side of major global oil producers and contributed to the current low prices we see today.

“U.S. oil production may hit an all-time high in 2018 despite prices at half of 2014 levels,” Nitesh Shah, Director of Commodity Strategist at ETF Securities, and Maxwell Gold, Director of Investment Strategy at ETF Securities, said in a note, pointing to expansions in shale oil from the Permian Basin and rising efficiency in off-shore oil in the Gulf of Mexico.

Related: Energy ETFs Should Respond to Oil Bounce

Investors shouldn’t forget about the demand side either, especially with a growing global economy. Citigroup projects a greater likelihood of persistent shortage of oil than a big jump in supply over the coming quarters. Ed Morse, global head of commodities at the bank, argued that a handful of OPEC members might already be pumping at maximum capacity already, and due to weak investment in exploration and development, there is a greater risk of a market squeeze once demand picks up, especially from a growing Chinese economy.

The Energy Select Sector SPDR Fund tries to reflect the performance of major oil companies in the S&P 500, including big integrated energy companies and other oil services stocks like Exxon Mobil 23.2%, Chevron Corp. 17.1%, Schlumberger 7.4%, ConocoPhillips 4.7% and EOG Resources.

For more information on the oil market, visit our oil category.