If you're a commodity stock investor, consider yourself on notice.

Some of the market's biggest energy stocks, miners and materials producers are showing some serious cracks in 2017. If key levels get violated, those heavyweights could be about to drag the rest of the sector lower -- at the exact same time the rest of the market continues to plow its way higher.

Simply put, you don't want to be left holding onto the only subset of the market that's not "working" right now -- so we're turning to the charts for a technical look at four huge commodity-centric stocks that could be about to turn "toxic".

Remember, technical analysis is a way for investors to quantify qualitative factors, such as investor psychology, based on a stock's price action and trends. Once the domain of cloistered trading teams on Wall Street, technicals can help top traders make consistently profitable trades and can aid fundamental investors in better entry and exit points.

Just so we're clear, the companies I'm talking about today are hardly junk.

By that, I mean they're not next up in line at bankruptcy court -- and many of them have very strong businesses. But that's frankly irrelevant to what happens to their stocks; from a technical analysis standpoint, sellers are shoving around these toxic stocks right now. For that reason, fundamental investors need to decide how long they're willing to take the pain if they want to hold onto these firms in the weeks and months ahead. And for investors looking to buy one of these positions, it makes sense to wait for more favorable technical conditions (and a lower share price) before piling in.

Without further ado, let's take a look at four "toxic stocks" to sell, and when to sell them.

Phillips 66

Leading off our list of potentially toxic trades is midstream energy giant Phillips 66 (PSX - Get Report) . Phillips 66 has been a hard name to like if you own shares -- year to date, this $40 billion energy stock has shed more than 10% of its market value, trailing the S&P 500 by a huge margin in 2017. But it gets worse - the price action is pointing toward a second leg lower this spring.

And PSX is within grabbing distance of that breakdown level.

Phillips 66 has spent the last couple of months forming a textbook example of a descending triangle pattern, a bearish continuation setup that signals more downside risk ahead. The pattern is formed by horizontal support down below shares at $77, and down-trending resistance to the upside. Basically, as shares pinball in between those two technically significant price levels, they've been getting squeezed closer and closer to a breakdown through PSX's $77 price floor. If that happens, this stock opens up a lot more downside risk -- shares are testing that breakdown territory this week.

Relative strength, the indicator down at the bottom of Phillips 66's price chart, adds an extra red flag to this trading setup. That's because PSX's relative strength line has been tumbling since the start of the year, indicating that this stock's underperformance is continuing into the spring. If shares violate $77, look out below.

PetroChina Co. Ltd.

We're seeing the exact same trading setup right now in shares of $207 billion Chinese energy giant PetroChina Co. Ltd. (PTR - Get Report) . Like Phillips 66, PetroChina has been forming a textbook example of a descending triangle setup following a selloff that started back at the start of the year. For PTR, the big breakdown level to watch is support at $72.50.

What makes that $72.50 level in particular so significant for PTR? It all comes down to buyers and sellers. Price patterns, like this descending triangle, are a good quick way to identify what's going on in the price action, but they're not the actual reason it's tradable. Instead, the "why" comes down to basic supply and demand for shares of PetroChina itself.

The $72.50 support level in PTR is a place where there has been an excess of demand for shares for the last month; in other words, it's a spot where buyers have been more eager to step in and buy shares than sellers have been to take gains. That's what makes a breakdown below $72.50 so significant -- the move means that sellers are finally strong enough to absorb all of the excess demand at that price level. So, if PetroChina's share price violates $72.50, you don't want to own it anymore.

Chevron Corp.

Like the rest of the energy sector, supermajor Chevron Corp. (CVX - Get Report) has been under pressure year to date, backsliding about 9% at the same time the rest of the S&P has been charging higher. And like the other two commodity-centric trades we've looked at so far, Chevron is showing more downside risk ahead; the big difference here is that Chevron's price action is about as basic as it gets.

Here's why:

Since peaking back in December, Chevron has been bouncing its way lower in a well-defined downtrend, a price channel formed by a pair of parallel trend lines. Those trend lines identify the high-probability range for shares of Chevron to remain stuck within. So far, every time this stock has rallied up to test trend line resistance, shares have been swatted lower in reaction. If you own this stock, it makes sense to sell the next bounce off of trend line resistance.

Waiting for that bounce lower before clicking "sell" is a critical part of risk management for two big reasons: It's the spot where prices are the highest within the channel, and alternatively it's the spot where you'll get the first indication that the downtrend is ending. Remember, all trend lines do eventually break, but by actually waiting for the bounce to happen first, you're confirming that sellers are still in control before you unload shares of Chevron.

BHP Billiton plc

Stepping away from the energy sector brings us to mining giant BHP Billiton plc (BBL) . While BHP may operate in a different segment of the basic materials sector than the other stocks we've looked at, the price action is showing some red flags just the same. BHP Billiton has actually been a strong performer in the last 12 months, rallying 27% during that time frame -- but the price action is signaling that investors might want to think about taking some of those gains off the table here.

BHP is currently forming a head-and-shoulders top, a classic bearish reversal setup that signals exhaustion among buyers. The pattern is identified by two swing highs that top out at approximately the same level (the shoulders), separated by a higher high (the head). The sell signal triggers when BHP's neckline gets materially violated -- that happens at the $30 price level, a line in the sand that's within spitting distance this week.

Remember to be reactionary with the BHP Billiton trade -- or any of the other potentially toxic setups on this list. Shares don't become a high-probability sell until they actually violate their price floor. Until then, BBL is simply waving a caution flag for buyers.

At the time of publication, author had no positions in the stocks mentioned.