All eyes were on the Bureau of Labor Statistics (BLS) last week. The federal agency provided two important inflation updates. And both were positive.

On Aug. 10, BLS announced that the July Consumer Price Index for All Urban Consumers (CPI-U), arguably the most important measure of inflation, remained unchanged from the previous month at 8.5%. One day later, the agency reported that the Producer Price Index (PPI) fell by 0.5% in July.  

Unsurprisingly, investors responded enthusiastically to the news. All of the major market indexes jumped last week. Did a surefire signal to buy stocks just flash?

Piquing interest

Two words have been bandied about quite a bit after the BLS reports -- peak inflation. There's a lot of speculation that after reaching a 40-year high, the inflation rate has reached its peak and is now headed down.

Declining inflation would seem to be great news for stocks. CNBC commentator Jim Cramer even said last week, "Peak inflation is nirvana for stocks, especially for out-of-favor stocks, like fast-growing tech plays or the financials or the consumer discretionary names." 

The Leuthold Group, which specializes in financial research for institutional investors, analyzed inflation peaks since 1945. They found that stocks do in fact tend to perform very well in the periods immediately after inflation peaks and begins to decline. 

There's a straightforward explanation for why this happens. Consumers have more money to spend with inflation rates falling. The Federal Reserve is less likely to raise the federal funds rate in an effort to slow down the economy. It's not surprising that investors would be more optimistic in such an environment.

Not a surefire signal

Peak inflation does appear to be a pretty good signal to buy stocks based on the historical performance of the S&P 500. Most of the time, the stock market indeed delivers solid gains when high inflation rates begin to come back down.

However, don't assume that there's always a strong inverse correlation between stock prices and the inflation rate. For example, the S&P 500 jumped after the inflation rate peaked in 1980. But the market gave up most of its gains in 1981 and the first half of 1982 even as inflation continued to decline significantly. 

US Inflation Rate Chart

US Inflation Rate data by YCharts

Is peak inflation a surefire signal to buy stocks? No. The Great Recession proves otherwise. Although inflation peaked in 2008 and fell dramatically afterward, the S&P 500 plunged. 

US Inflation Rate Chart

US Inflation Rate data by YCharts

Of course, the events that occurred in 2008 were definitely outliers. It seems unlikely that the stock market will sink if inflation declines markedly in the current environment.

Potential stocks to buy

Even if peak inflation isn't a surefire signal to buy stocks, history shows that it's a pretty good signal to do so. But which stocks are ideal to buy right now?

I think that fintech stocks could be big winners. For example, PayPal (PYPL 0.44%) has already delivered a solid rebound in recent weeks. Lower inflation would help the company quite a bit.

It's possible, though, that the July inflation numbers could only be a head fake. If so, there are still some stocks that could fare well. Vertex Pharmaceuticals (VRTX 3.04%) especially stands out, in my view. Vertex has trounced the overall market so far this year as the inflation rate soared.

Sales for the company's cystic fibrosis drugs continue to grow robustly. Vertex plans to file for regulatory approvals of a potential cure for rare blood disorders sickle cell disease and transfusion-dependent beta-thalassemia in the coming months. It has several promising programs advancing into late-stage clinical studies as well.

Vertex also remains a bargain with a price-to-earnings-to-growth (PEG) ratio of only 0.44. Any PEG ratio below 1.0 is considered to be an attractive valuation. Peak inflation might not be a surefire signal to buy stocks, but Vertex appears to be about as close to a surefire stock to buy right now as any.