Market uncertainty can make any investor think about diversifying, so Jim Cramer took to the charts to find out why consumer foods giant General Mills could be poised for a rally.

The "Mad Money" host turned to Larry Williams, an legendary technician whose calls have always intrigued Cramer over the years.

"Williams started with the assumption that a major food conglomerate like this one would probably have seasonal and cyclical patterns based on both the consumption habits of their products as well as the agriculture cycles," Cramer said.

Tracing General Mills' trajectory back to 2015, Williams combined two key patterns, a 125-day cycle and 425-day cycle, to form this chart's red line:

"This tool has been a pretty accurate indicator of where the stock has headed, and now it suggests that General Mills is ready to have a bit of a bounce, followed by a modest pullback, and then off to the races in a major rally sometime this summer," Cramer explained.

But the underlying fundamentals matter too, Cramer said. General Mills is an international giant, meaning its numbers rely in part on the direction of the U.S. dollar. A weak dollar is good for the company because stronger foreign currencies mean more dollars for U.S. players; a strong dollar can hurt earnings.

Following that, Williams decided to track General Mills' stock alongside the Dollar Index. That chart indicated that the dollar's moves actually predict where General Mills shares will go five months later.

Based on Williams' analysis, now that the dollar is rallying, General Mills could get hit hard in 160 or so days, followed by a health summer rally.

Cramer's view? "I like CEO Ken Powell very much. He's been pushing the company toward much more natural, healthy, organic [products]," Cramer said. "But at the same time, the company did report a not-so-hot quarter last week, including its seventh straight revenue decline. That should make me more cautious, right?"

But if General Mills sees a turnaround, its 3.25 percent yield could make it an attractive buy, or an interesting takeover target for Kraft Heinz.

Still, for Cramer, that's a big "if." His bottom line?

"The charts ... suggest that the beaten-down General Mills could soon be ready to roar, a bold contrarian call from a brilliant guy with a fabulous track record. My instincts say that if you want to own a food stock for diversification or you're going for the fundamentals, you buy PepsiCo, a name that's owned by my charitable trust."

But if you're a patient investor and are willing to go as bold as Williams, "then you've got my permission to buy the General," Cramer added.