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

NEW YORK (TheStreet) -- The perfect recipe for a rejuvenated stock market may be illusive but it is possible, Jim Cramer told his Mad Money viewers Thursday, after the markets opened lower, but ended the day in the green.

There were five things, five ingredients, in today's rally recipe. The first was a $2 decline in oil. After rallying in a straight line from its lowers bear $43 a barrel to its highs of $62, today's decline in oil was a welcomed one, as the stocks of everything from restaurants to retail to airlines have been in sharp decline ever since oil began its rise.

The second ingredient was a weaker dollar. As long as the dollar is on the move, the big international stock won't be, so today's pause was welcomed news.

The next ingredient needed for a rally is a wall of pessimism, which gives smart investors a chance to buy when others are panicking. Today's weak open provided that in spades today.

Fourth, there's interest rates, which actually fell a little today. That, in turn, changed the landscape for rate watchers, as least in the short term.

Finally, there were some positive earnings. While stocks like Whole Foods Market (WFM) and Keurig Green Mountain (GMCR) made headlines for their horrible results, there was also Tesla Motors (TSLA), up 2.7%, Alibaba (BABA), up 7.5%, and semiconductor maker Qorvo (QRVO), finishing the day up 9%.

If you liked this article you might like

Eating McDonald's Stock Might Make You Sick

Investors in Restaurant Stocks Still Need Strong Stomachs

Why Hurricane Harvey Has Flooded These Restaurant Stocks With Sell Orders