Stocks rose on Friday despite a tumble in Amazon shares after economic data pointed to slowing inflation and a steady consumer.

The Dow Jones Industrial Average added 807 points, or 2.5%. The S&P 500 gained 2.4%. The Nasdaq Composite fought higher and was up by 2.7% after opening lower initially.

The stock market has fractured this week as investors dump technology shares following weak results and outlooks from Microsoft, Alphabet and Meta and rotate into economically sensitive stocks that will benefit if the U.S. economy can skirt a recession.

Amazon plunged by 10% after the company posted weaker-than-expected quarterly revenue and issued disappointing fourth-quarter sales guidance Thursday. Apple shares were initially lower too in extended trading Thursday after the company reported weaker-than-anticipated iPhone revenue, but the stock has reversed and was last up more than 7%. The company beat Wall Street estimates for quarterly earnings and revenue.

Apple and other more positive performers, like Intel, have given investors footholds within what some see as a particularly tumultuous tech sector, subsequently providing upward pressure to the tech-heavy Nasdaq, said Jay Hatfield, CEO of Infrastructure Capital Management. He said the market was also boosted by oil giants Chevron and Exxon Mobil, up 0.7% and 2.5%, respectively, after both reported beating expectations before the bell.

“Apple’s really the lone star, if you will, of the mega-cap tech stocks,” Hatfield said. “It’s just a unique market where bad is terrible, but OK is good, so, on a relative basis, it’s spectacular.”

The market got a boost after the core personal consumption expenditures price index in September increased 0.5% from the previous month and 5.1% from a year ago, still high but mostly in-line with expectations. This is the preferred gauge of inflation for the Federal Reserve. Personal spending rose 0.6%, more than expected, the data showed.

The major indexes are all on track to end the week higher. It would be its fourth positive week in a row for the Dow, which is up about 5%, for the first time since a 5-week streak ending in November 2021. The S&P 500 and Nasdaq are up about 2% and 1.5%, respectively, this week.

The Dow is on track for its best month since January 1976.