BALTIMORE (Stockpickr) -- All of a sudden, oil's back from the dead.

In 2015, oil has been one of the most toxic things you could have held in your portfolio. For a year when stock performance has already been hard to come by, just about anything in the energy sector has been a lead weight on your performance.

But that's changed in recent weeks. If you'd invested in the U.S. Oil Fund  (USO - Get Report) back in the last few days of August, you'd be sitting on gains approaching 22%. For comparison, the big S&P 500 is only up 2.8% over that same stretch. In short, oil has started rebounding just as eagerly as it sold off earlier this year.

The important question now is whether the recent move in oil prices marks a major change in trend or whether it's just another relief rally before the next major down move. Today, we'll take a closer look at what's driving the price action in oil -- and the stocks you can buy to profit from it.

First though, it's worth taking a closer look at oil prices. To do that, we'll use the U.S. Oil Fund, the $2.6 billion ETF that acts as most investors' most direct investible proxy for "oil."

It really doesn't take an expert technical trader to figure out what's been going on in shares of USO. Since last summer, this big fund has been moving down and to the right, selling off to the tune of 60%. That's pretty abysmal performance. And as the long-term chart of USO shows, the primary downtrend is still very well intact despite the recent rebound in oil prices.

That's a pretty big red flag -- and it's one that should give energy investors some serious cause for concern here. More significantly, oil prices are moving back up to their trend line resistance level, a place that swatted energy values lower a year ago and again back in late June. A move down off of the top of that downtrend line would be a pretty major signal that it's time to take gains off the table while you still can.

It's also important to put the recent move in oil prices in the context of other asset classes. Even though oil has been rallying lately, it continues to underperform pretty much everything else from a relative strength standpoint in the long term.

The good news for energy investors is that it's not time to panic yet.

Even though the long-term view of oil isn't pretty, it's not a death sentence. All trends eventually end, after all. And zooming in to a shorter-term view of oil gives us some important context.

Since the start of August, USO has been forming an ascending triangle pattern, a bullish price setup that's formed by horizontal resistance above shares (at $16 in the case of USO), and uptrending support to the downside. That setup isn't "textbook," but it does give oil the possibility of a pretty important breakout buy signal at the exact same time that crude is testing the top of its downtrend.

For Brent crude spot prices, that $16 breakout level in USO is the same as $52.50 on the spot chart.

There's clearly a pretty important battle going on between buyers and sellers of oil right now. And with USO so close to the top of its trend line, I think it makes a lot of sense for oil bulls to wait for that trend to get broken before buying. Consider taking a starter position if we get a sustained breakout above $16 this week, but a move above $17 in USO is the much more important signal.

The thing is, USO isn't the best way to play a major change in trend in oil prices. The oil companies are.

The chart above shows the price action in ConocoPhillips  (COP - Get Report) , but it could really be a chart of any oil company. There's only really one chart in the oil exploration and production industry right now because pretty much every name in the industry looks the same.

Like the USO chart, ConocoPhillips has been forming an ascending triangle bottom. The difference here is that shares of ConocoPhillips actually broke out above $50 resistance last week, leading spot oil to an important move higher.

Outperformance in oil companies actually makes a lot of sense. It's best to think of these as leveraged bets on oil prices. Since production costs are relatively static, any increase in spot oil prices results in a dollar-for-dollar increase in gross profits. And that means that, if we are witnessing an end to the primary downtrend in oil prices, energy companies such as ConocoPhillips, ExxonMobil  (XOM - Get Report) , Chevron  (CVX - Get Report)  and Marathon Oil  (MRO - Get Report) are going to be the best way to play it. (For another take on ConocoPhillips, check out "ConocoPhilllips Extends Breakout, but Momentum Is Fading.")

For that same reason, oil producers are going to be the worst way to get exposure to oil prices if the downtrend does hold and spot oil takes another big bounce lower.

But for defensive investors who want exposure to the energy sector, there's a better option.

It might come as a surprise that some corners of the energy sector haven't been selling off in 2015. In fact, these energy plays have actually been rallying hard, outperforming the rest of the market by a huge margin. Case in point: midstream energy refiner Phillips 66 (PSX - Get Report) .

The chart for Phillips 66 couldn't look much more different than the price action in its former parent ConocoPhillips. Shares of Phillips 66 are up more than 16% since the start of 2015, and shares are forming a more conventional ascending triangle setup with resistance up at $84. Even though this pattern hasn't triggered a buy in Phillips 66 yet, it still looks a whole lot more attractive than what E&Ps are doing right now. The absence of a longer-term downtrend on this chart makes it a better choice for defensive investors, even if it won't rally as hard on a move higher in crude oil.

A breakout above $84 in Phillips 66 would shove this stock to new multi-year highs -- and a retest of all-time highs set last fall. That's a very bullish stance from a technical standpoint.

Likewise, relative strength (not to be confused with RSI at the top of the chart) in Phillips 66 is holding onto its uptrend, signaling that shares are continuing to outperform the S&P 500 this fall.

Phillips 66 and other refinery peers such as HollyFrontier  (HFC - Get Report) and Tesoro Petroleum  (TSO) look attractive from a technical standpoint -- and not just relative to the rest of a beaten-down sector, either.

Unfortunately, I can't answer the question of whether this energy rally is here to stay with any certainty at this point. No one can.

Instead, what we can do is identify the levels at which the move in oil prices becomes technically meaningful. The technical charts I've shown you today aren't a crystal ball. They're a risk-management tool.

We're not there yet, but we're close.

In the meantime, it makes sense for risk-averse investors to buy pockets of energy strength such as refiners. For traders willing to take on a little more risk, it's a prudent move to use smaller position sizes until oil prices can definitively break through the top of the downtrend that's corralled the whole energy sector lower for the past year and a half.

Until that happens, assume that oil is seeing a relief rally in the context of a pretty brutal long-term downtrend. Don't fight the tape. For now, oil's chart is still moving down and to the right this fall, but it could be about to get pretty interesting.


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