The S&P 500 ended higher on Wednesday, stretching its winning streak to five sessions, as the latest inflation data reassured investors betting the Federal Reserve would start cutting U.S. interest rates next month.

The Nasdaq Composite also posted its fifth straight daily gain, although it barely scraped into positive territory as Alphabet and some megacap tech stocks weighed.

Moves were generally subdued with many investors away for August vacations, and new triggers for trading were absent, contributing to an overall listless picture among the benchmarks.

The latest U.S. consumer price data, released earlier on Wednesday, reinforced expectations that the Fed would start interest rate cuts in September.

U.S. consumer prices rose moderately in July, and the annual increase in inflation slowed to below 3% for the first time since early 2021. A day earlier, softer-than-expected producer prices data indicated inflation continued to moderate, although not yet all the way to the U.S. central bank's 2% target.

Money markets now see a 55% chance of a 25-basis point (bps) rate cut at the Fed's Sept. 17-18 meeting, as per the CME FedWatch Tool. Before the data, traders were nearly evenly split between a 25-bps and 50-bps cut.

Scott Ladner, chief investment officer at Horizon Investments, said he called days such as this "markets violently going nowhere", adding with CPI painting a similar picture to PPI data, there was no reason for traders to reassess moves put in place on the previous day.

"There's no huge rationale to move prices one way or another," he said.

The S&P 500 closed at 5,455.21, up 0.38% or 20.78 points. The Nasdaq Composite closed at 17,192.60, up 0.03% or 4.99 points. The Dow Jones Industrial Average closed up 242.75 points or 0.61% at 40,008.39.

Shares of Alphabet, the Google-parent, dropped 2.3% on a media report that the U.S. Department of Justice is considering options that include breaking up the online search engine.

Other megacaps were mixed: Tesla slumped 3.1% and Meta Platforms dropped 0.3%, while Microsoft fell 0.7% and Nvidia declined 1.7%.

A rebound in megacap and tech stocks has helped markets recoup most losses from a global market rout early this month after data showed the U.S. unemployment rate surged in July.

Thursday's release by the Commerce Department's Census Bureau of retail sales data will be keenly watched by those concerned about the overall strength of the American economy, Horizon's Ladner said.

These worries had sent the Cboe volatility index, Wall Street's fear gauge, to its highest since 2020 just last week. However, on Wednesday, it stayed below its long term average of 20 points for the second day to close at 16.19.

The seven trading sessions it took the VIX to return to its long-term median of 17.6 is the index’s quickest ever drop from 35, a level associated with a high degree of fear, according to a Reuters analysis.

A majority of the major S&P sectors were in positive territory, led by a 1.3% rise in financials. Its advance was aided by gains of more than 4.6% by Progressive and Charles Schwab, which rose after positive July performance numbers, and Allstate, which climbed after agreeing to sell a business unit.

Both of the insurers ended at record closing highs.

Kellanova surged 7.8% after family-owned candy giant Mars said it would buy the Cheez-It and Pringles maker in a nearly $36 billion deal.

Cardinal Health gained 3.7% after the drug distributor raised its 2025 profit forecast. (Reporting by Medha Singh and Shashwat Chauhan in Bengaluru and David French in New York; Editing by Maju Samuel and David Gregorio)