It was just a few weeks ago that Jim Cramer warned investors that the S&P oscillator was in severe overbought territory. Now that the oscillator has bounced back, he revealed four themes to embrace and avoid.

The S&P 500 oscillator measures the level of buying and selling pressure. It previously had a reading of 10, which indicated to Cramer that there was an excessive amount of buying in the market and it was time to ring the register.

"The bulls were lucky that this decline wasn't more damaging and permanent, in that every time the market takes a sharp leg down, more people flee from the whole asset class," the "Mad Money" host said.

Rather than advise investors to go out and buy all stocks, Cramer identified four themes that are worth embracing: all semiconductors, pet, biotech and steel stocks.

He recommended staying away from restaurants, retailers, airlines and apparel.

Aaron McCoy | Getty Images

Cramer's top choice for opportunity was the pet segment, as people continue to humanize their animals and spend more money.

"I still believe that the best secular growth story in the world right now isn't the internet of things or cloud adoption or social or mobile … if you're looking for a rising tide, I say look at the growth of spending on companion animals," Cramer said.

When Cramer spoke with Idexx Laboratories CEO Jonathan Ayers, he highlighted owners' increased dedication toward pets, like pets being allowed to sleep in the bed or the surge in health care spending on animals. When Idexx reported results on Tuesday, it delivered a beat and raise quarter. Management attributed the strength to "accelerated companion animal gains."

The third theme was biotech, which is showing signs of promise when stocks like Biogen with earnings that weren't so hot still ran higher.

"It looks like the long national nightmare that was biotech is finally over," Cramer said.

As for the steel stocks, this group is benefiting from the tariffs placed on Chinese and South Korean steel. AK Steel had a positive reaction to this, and Cramer's favorite is Nucor.

The restaurants are in a world of pain thanks to a combination of higher wages and lower traffic. DineEquity reported an astounding 4.2 percent decline in same-store sales at Applebee's, which was twice as bad as Cramer expected.

With the exception of the dollar store stocks, all of retail is getting slammed, too. Cramer is still steering clear of airlines, as overcapacity, price wars, the strong dollar and Zika virus are all hurting the group.

"If you own retailers, restaurants, apparel companies or airlines then you could be in for some real turbulence, at least until the end of earnings season," Cramer said.