CNBC's Jim Cramer leaned on chart analysis from Larry Williams to say inflation could peak and the market could recover soon.

The charts and the history suggest that inflation could soon peak, and then the stock market is due for a nice broad rally given from, as interpreted by Larry Williams. The host said it wouldn't surprise him if he was right on both.

He said that his forecast suggests that we will get a pullback going into August and that stocks will rebound as we approach the end of the summer.

Cramer explained that there are two ways of approaching inflation according to the technician.

  • Sticky consumer price index. This measures the cost of a basket of important items that change price slowly.
  • Flexible consumer price index. This measures the cost of a basket of important items that change price rapidly.

The sticky price is orange while the flexible price is black.

Cramer said that Williams noticed that the flexibleCPI is at a record high and in the zone where inflation usually peaks.

The three-month rate of change is black with the 12-month rate of change brown, going back to 2016

Cramer said that the flexible consumer price index is a good indicator of the sticky consumer price index because after flexible goods prices start climbing stickier goods start catching up. The chart shows the flexible price.

This tells Larry that we might be turning the corner on inflation. Cramer said it was not obvious to anyone on the surface.

According to Williams, inflation has stayed above 2.5% for about 29 months on average before dropping. Cramer said that inflation has held above 2.5% for 14 months, meaning we might already be halfway through.

Cramer said that Williams observed that theCPI has a five-year cycle, which suggests that it should peak around the middle of this year and keep tumbling. The chart shows the cycle.

Cramer said that Williams uses the Advance Decline Line to measure the number of stocks that are increasing daily compared to the number of stocks that are decreasing.

Cramer said that Williams likes to use the advance/decline line to make projections.

If you can see where the advance/decline line might be headed, you will know when rallies or declines are most likely to occur. He said that this is a more stable way to take the temperature of the market than looking at a particular index.

The advance/decline line goes back to May 2021. The forecast is in red.

The dominant short-term cycle in the advance/decline line has lasted for about 60 days. Cramer said the red line combines the two cycles to give a forecast.

He said that the forecast suggests that the stock market could go up in May, and that it is time for the advance/decline line to go higher.

The CNBC Investing Club will follow Jim Cramer's every move in the market.

There is no truth to this.

Questions for Cramer? Cramer can be reached at 1-800-743-CNBC.

Do you want to dive into Cramer's world? Hit him! Jim Cramer is on Mad Money.

Questions, comments, suggestions for the Mad Money website? madcap@cnbc.com