Hurricanes can have surprising economic effects, Jim Cramer told his Mad Money viewers Tuesday, and none more so than with oil refiners affected by flooding in Texas from Hurricane Harvey.

Cramer went "Off the Charts" with Bob Lang, the founder of ExplosiveOptions and a contributor to's Trifecta Stocks newsletter, to get a better sense of what's happening in the sector. 

Refinery stocks had been doing well before the hurricanes, thanks to summer gasoline demand expanding the spread between what refiners pay for crude and what they make from selling the end product. But when an oil refinery gets taken offline, the price of oil stays pretty much the same while the price of gasoline rises, boosting profits for these companies.

So when Harvey flooded the coast of Texas and Louisiana, where so many refineries are located, a lot of capacity was shut down, and that ended up being a huge boon for refiners, according to Cramer.

The so-called 3-2-1 crack spread, a key metric for the industry derived by subtracting the cost of three barrels of crude from two barrels of gasoline and one barrel of fuel oil, has been surging. Refinery stocks have followed suit. The VanEck Vectors Oil Refiners ETF (CRAK) - Get Report is up more than 10% since bottoming in early June, with much of that strength coming in recent weeks.

Image placeholder title

Lang is interested in several of the refiners, starting with Andeavor, (ANDV) , formerly known as Tesoro Petroleum. Lang thinks the chart is attractive. Andeavor bottomed in April and since then it's made a series of higher highs and higher lows. The Chaikin Money Flow Oscillator, which measures the level of buying and selling pressure in a stock, has been strong in the case of Andeavor with big institutional investors accumulating shares aggressively. The Moving Average Convergence Divergence, or MACD, indicator, which helps technicians detect changes in a stock's trajectory before they happen, just flashed a bullish crossover, where the black line goes above the red one, a few weeks ago. That's a fairly reliable signal, and sure enough, the stock has surged since it happened.

During August, Andeavor pulled back. Lang points out that the decline happened on lower volume, a signal that it wasn't going to be long-lasting. Since then, the stock has surged back, and its sideways action in recent sessions has created a bullish flag pattern. That's where a stock goes up rapidly, consolidates for a little while, and then resumes its rally. Lang thinks that Andeavor is close to breaking out of the flag pattern and roaring again, and he wouldn't be surprised if this $103 stock can go to $110 in the not too distant future.

Another plus for the stock, according to Cramer, is that none of Andeavor's refineries were in Harvey's path. They're benefitting from the shutdowns along the gulf coast more than anybody else, because in addition to a bigger crack spread, Andeavor also gets to take some market share from its competitors.

Image placeholder title

Valero (VLO) - Get Report , the largest independent refiner in the world, had to shut down five refineries in Texas, but has many more outside the region. Lang says that the recent price action in Valero has been impressive. However, there are more question marks than with Andeavor. For example, the Chaikin Money Flow oscillator has been in negative territory since July, and it actually went lower as the stock was climbing in recent weeks. On the other hand the Moving Average Convergence Divergence indicator made a bullish crossover at the end of August, and Valero has momentum on its side. The stock just broke out above $70 today and from these levels, Lang wouldn't be surprised if it's smooth sailing up to $77 or even $80.

Image placeholder title

Finally, there's HollyFrontier (HFC) - Get Report , a midwestern refiner with a stock that's up 40% since early June. This is another chart that Lang really likes. First of all, HollyFrontier made a bullish flag pattern starting in the second half of August as the stock soared, then leveled off for a little bit, then began rallying again last week. Today the stock broke out above $33 and Lang thinks that could mean HollyFrontier's headed to $40. One more thing: Lang notes that volume has been very strong on up days for HollyFrontier, a classic sign that big institutions are loading up on the stock.

On Real Money, Cramer says get over it: Infrastructure and tax reform aren't happening this year. Invest in what is growing. Get Cramer's insights with a free trial subscription to Real Money.

Cramer and the AAP team are adding to their position in Nucor Corp. (NUE) - Get Report . Find out what they're telling their investment club members and get in on the conversation with a free trial subscription to Action Alerts PLUS.

Search Jim Cramer's "Mad Money" trading recommendations using our exclusive "Mad Money" Stock Screener.

To read a full recap of this episode of "Mad Money," click here.

To watch replays of Cramer's video segments, visit the Mad Money page on CNBC.

To sign up for Jim Cramer's free Booyah! newsletter with all of his latest articles and videos please click here.

Action Alerts PLUS

, which Cramer co-manages as a charitable trust, had a position in NUE.