Markets have been rallying all week and all month. Investors are starting to believe that inflation, which has been at a 40-year high this year, may finally be starting to peak. This would be good for the market because a hawkish Federal Reserve has been aggressively raising its benchmark overnight lending rate, the federal funds rate, in an attempt quickly get control of the situation. But with the Fed moving so quickly, the market is concerned that the agency might tip the economy into some kind of severe recession.

So, the recent data is certainly good news. But has inflation really peaked? It's actually hard to say at the moment. Here is what we know so far.

There's encouraging data, but more work to do

Fresh data for the Consumer Price Index (CPI), which tracks prices on a range of daily consumer goods and services, showed that the index rose 8.5% on a year-over-year basis in July. It shows that prices are high, but the CPI rose 9.1% year over year in June, and economists had projected an 8.7% rise in July. Furthermore, the CPI remained unchanged month to month.

Person on computer showing stock charts.

Image source: Getty Images.

The move was largely driven by a decline in energy prices, which fell 4.6% from June. Fuel oil fell 11% month over month, while gasoline fell 7.7%. Energy services also came in roughly flat from June because utility gas services fell 3.6% in July.

The news is undeniably good and suggests that inflation may be peaking. But there are still some goods and services in the CPI that consumers paid up for in July. For instance, food prices did not seem to slow down with groceries rising 1.1% in July, which is more than food prices rose in June on a monthly basis. Prices on medical care commodities including items such as drugs, equipment, and supplies rose 0.6% in July, the largest monthly increase since January.

And of course, shelter prices stayed pretty hot, rising 0.5% in July after rising 0.6% in May and June. Within the shelter category, the rent index rose 0.7 percent in July after rising 0.8% in June, which was the largest monthly increase since 1986. There has certainly been progress, but experts think the Fed still has work to do to get inflation under control.

"If you strip off any of the headline noise, some of the ... CPI, even PPI [numbers] show still upward pressures," Ben Emons, managing director at Medley Global Advisors, recently told CNBC. "The Fed cannot be done here. It probably means that the 75-basis-point (0.75%) rate hike remains on the table."

Considering that energy drove the decline in inflation, I ultimately still think it's too early to say whether or not inflation has peaked. That's because oil prices, which have led to the recent dip in inflation, could march back up by the end of the year. Analysts at Goldman Sachs still think oil prices could hit $130 per barrel (they currently hover around $90) due to the shortage the market is experiencing, with the price of a gallon of gas once again hitting $5.

Inflation's peak is not yet definitive

I think you have to be encouraged by the recent July CPI data. Not only did energy prices subside significantly in July, but there was progress in other areas, too. With that said, prices remain high in certain sectors of the CPI and the outlook for oil is still not positive.

However, one thing investors should understand is that the brunt of the Fed's rate hikes have only just begun to seep into the economy. It takes time to feel the full effect of a rate hike, and the Fed did two monster 0.75% rate hikes in June and July, so I do think those will continue to bring down inflation. But that also means that the rate hikes could tip the economy into a more severe recession.

I am cautiously optimistic right now, but some of the uncertainty that has existed all year remains. When it comes to inflation, we're still in a holding pattern as far as I'm concerned, and I'll be looking for more progress in August.