NEW YORK (AP) — U.S. stocks are drifting upward on Friday, as Wall Street nears the end of one of its worst weeks since the 2020 coronavirus crash.

The S&P 500 was 0.7% higher in afternoon trading after earlier wavering between a loss of 0.8% and gain of 1.1%. The Dow Jones Industrial Average was up 113 points, or 0.4%, at 30,040, as of 2:50 p.m. Eastern time, and the Nasdaq composite was 1.8% higher.

The relatively quiet trading caps what’s been a tumultuous week. The S&P 500 is still on track for a loss of 5.4%, which would be its tenth drop in the last 11 weeks. Earlier in the day, when it seemed to be heading for a loss of more than 5.7%, it was on pace for its worst week since March 2020, when stocks were in free-fall as the global economy suddenly shut down at the onset of the pandemic.

Markets around the world have shuddered as investors adjust to the bitter medicine of higher interest rates that Federal Reserve and other central banks are increasingly doling out. Higher rates can bring down inflation, but they also risk a recession by slowing the economy and push down on prices for stocks, cryptocurrencies and almost all investments.

“Any lack of clarity or lack of confidence in the Federal Reserve is going to create a lot of volatility in the market,” said Megan Horneman, chief investment officer at Verdence Capital Advisors.

The S&P 500 remains in a bear market after it earlier this week dropped more than 20% below its record. It’s now about 23% below its all-time high set in January and is back to where it was in late 2020.

“There’s a lot of uncertainty right now about the timing of a recession, but the risks are clearly rising,” Horneman said.

On Wednesday, the Fed hiked its key short-term interest rate by triple the usual amount for its biggest increase since 1994. It could consider another such mega-hike at its next meeting in July, but Fed Chair Jerome Powell said increases of three-quarters of a percentage point would not be common.

The Fed has also just begun allowing some of the trillions of dollars of bonds it purchased through the pandemic to roll off its balance sheet. That should put upward pressure on longer-term interest rates and is another way central banks are yanking supports propped underneath markets to bolster the economy early in the pandemic.

The Fed’s moves are happening as some discouraging signals have emerged about the economy, such as weakening sales at U.S. retailers, even if the jobs market remains solid. That has raised concerns the Fed’s actions could wind up being too aggressive.

Powell will testify before Congress this upcoming week on monetary policy, and what he says is sure to guide trading. The testimony is scheduled for Wednesday and Thursday, which could mean more steep swings for Wall Street.

In the six days since a game-changing report showed U.S. inflation is accelerating, not easing as investors had hoped, the S&P 500 has had three days where it tumbled at least 2.9%. That’s happened only five other times total in the last year.

For Friday at least, trading was calm as Treasury yields eased further from their highest levels in more than a decade and a measure of nervousness on Wall Street sank.

The yield on the 10-year Treasury pulled back to 3.23% from 3.30% late Thursday and from a peak of nearly 3.50% earlier in the week.

Higher yields have been pounding all kinds of investments this year, but the harshest pain has hit cryptocurrencies, high-growth technology stocks and others that flew the highest in the earlier, easier days of ultralow rates.

Gains for technology stocks on Friday helped the Nasdaq lead the market. Microsoft climbed 2%, and Amazon climbed 2.6%.

Other stocks hit particularly hard Thursday on worries about a possible recession and inflation overwhelming consumers were also bouncing back. Norwegian Cruise Line rose 9.4%, and American Airlines Group gained 6.8%. Both are still down more than 10% for the week, though.

Stocks of smaller companies, which tend to move more with expectations for the strength of the U.S. economy, were also doing better than the rest of the market. The Russell 2000 index of smaller stocks was 1.3% higher, but it also was still down much more for the week than the broader market.

U.S. markets will be closed Monday in observance of the Juneteenth holiday.