The market on Thursday had all of the right ingredients for a major bull rally. But Jim Cramer warned to be careful—sometimes you will get what you want, and you won't be ready for it.
It was a terrific setup that allowed the averages to roar, with just the right price for oil and the dollar, a dash of excessive pessimism and solid earnings. Cramer dove into each topic independently, so investors could understand why the market was able to rally.
The first thing that the market needed was for oil to stop going up. In one blink of an eye, it has an amazing power to drop $2. When the price of oil goes up, that's the equivalent of taking away an awesome tax cut for people. Of course they're not going to like it!
"The speed with which oil's been rallying and the consistency of the move, the sheer viciousness of it, has totally obliterated the positive stories that had been driving whole swaths of the market," the "Mad Money" host said.
From its low at $43 to its peak at approximately $62 on Wednesday, oil was up more than 42 percent. That's a big deal! Take one look at the charts of any retailer, restaurant or airline, and it is clear that these stocks coincide with the bottom in oil. This parity has caused these stocks to act horrendously.
Because big portfolio managers are always trying to figure out when earning speak. They made the judgment that these stocks peaked last quarter, and only the international and activist linked stocks did well. So a day like Thursday when oil finally went lower was nothing but good news.
The second item that is needed is for the dollar to stay weak. If a company's sales or margins were hurt by a strong dollar that meant its stock didn't go higher. But the big chink in the chain was that the money from these big international companies was rotating into the restaurants, retailers and healthcare stocks.
But then when oil started to rally, people became worried about raw costs, and that affected the restaurants, retailers and healthcare stocks.
See how they are all connected?
The third positive attribute on Thursday was all of the bad news recently made investors pessimistic. Yes, that's a good thing! They expected stocks to go down on Thursday when Fed Chief Janet Yellen said on Wednesday that stocks were overvalued—and then they didn't.
"Just as I abhor big up-openings, I like it when the market's looking down big at the open. Then people don't get picked off. If you have your shopping list you can buy when others are panicking," Cramer added.
Finally, there were earnings. Some may have been jolted by the disappointing same-store sales from Whole Foods, and perhaps some were shocked that Tesla didn't go higher. But the big upside was Alibaba, which reminded the market that it can still go higher.
Read more from Mad Money with Jim Cramer
Cramer Remix: How to benefit off the Fed
Cramer: Einhorn was dead wrong on EOG
Cramer: Thanks for nothing, Janet Yellen!
"So far, every day like this in 2015 has been pretty much a one-day wonder with everything positive getting reversed the next session," Cramer said.
Thus, investors must be prepared for the bulls to go back in hiding. Especially as there is the big April employment report on Friday.
Ultimately, the stellar combination of lower oil, a weaker dollar and positive earnings with a dose of pessimism made for a rally. That's the secret recipe. It can happen once, so it can happen again. Just be ready when it inevitably reverses.