It's been a tough year for shares of oil and gas producers.

While oil prices have been strong in 2019, up about 21% since the calendar flipped to January, and on-pace with the stock market this year, natural gas has been a major drag for energy companies. Natural gas has shed about 10% of its cost year-to-date, pulling prices for exploration and production stocks with heavy exposure to natgas down along with them.

As a result, the average E&P stock entered September down almost 19%, based on an index that tracks the industry.

But oil and gas producers are starting to look energized this month - and they could be kicking off a major change in trend that leads to higher prices for these stocks in the long run.

To figure out how to trade the trend, we're turning to the charts for a technical look.

For our purposes of looking at the whole industry in one shot, the instrument we're focusing on here is the SPDR S&P Oil & Gas Exploration & Production ETF (XOP - Get Report) , a $1.73 billion exchange-traded fund that owns a basket of 63 exploration and production stocks.

At a glance, you don't need to be a technical trading expert to figure out that XOP has been stuck in a pretty ugly downtrend since the beginning of April. In that four-month stretch, this ETF has actually shed about 30% of its market value, precipitated by a steepening decline in natgas prices.

But it looks like that selloff was overdone - and as shares break out of that well-defined downtrend range this week, they're clearing the way for buyers to make up for lost time.

That's confirmed by relative strength down at the bottom of the chart, which broke out of its own downtrend at the start of this month. That signals that XOP is starting to systematically outperform the rest of the broad market in September. Likewise, momentum, measured by 14-day RSI up at the top of the XOP chart, just broke out of its own bear market range, indicating that buyers are back in control of things.

Context matters a lot in this market. The fact that XOP has underperformed so materially at the same time that the S&P 500 has charged more than 21% higher on a total returns basis in 2019 means that E&P stocks could find considerably more buying power as investors searching for some semblance of value in a rich market rotate into industries that haven't participated in that upside yet.

As always, risk management is crucial here. If XOP violates prior lows at $21, then the bullish trend reversal is off, and XOP opens the door to more downside. Meanwhile, shares look primed for a move higher in the intermediate-term.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.