(Bloomberg) -- Two days of violent selloffs, followed by a rally and then a fade. Traders are left bracing for what could be a wild end to one of the worst weeks of the year.

The S&P 500 Index rose 0.7 percent as of 1:58 p.m. in New York, down from a gain that reached 1.7 percent. The index all but erased that rally before rebounding after JPMorgan analysts said selling forced by computer-driven strategies had likely run its course.

The tumult has Wall Street on tenterhooks as the final hours of the week loom.

For Christopher Harvey, head of equity strategy at Wells Fargo, there’s little chance the gains will hold up as traders keep paring risk. While that would cap the worst week for stocks since March and be painful, it would probably set up the market for a potential bottoming process next week, he said.

“For us to get constructive on the equity market, we’d like to observe more of a washout and Friday would be that day,” Harvey wrote in a note to clients. “If all goes according to our plan, U.S. equity markets would end the trading day on or close to their intra-day lows with a late-day fade,” he said. “If the downdraft follows us to Monday’s open, we can talk about buying opportunities and some cash investments.”

Matt Maley, an equity strategist at Miller Tabak & Co., wasn’t surprised by the midday swoon, and remained confident the market would rally into the close.

“This is exactly the kind of scary midday decline I thought we’d get today,” he said. “So this does not change my thinking that the market will close at or near its highs for the day. Then again, I said the market would close in positive territory yesterday.”

U.S. stocks are heading for their worst week since March as higher bond yields, trade tensions with China and concern over earnings all converge to stir volatility in the market. The S&P 500 has lost 5 percent, poised for its third weekly retreat.

To contact the reporter on this story: Lu Wang in New York at lwang8@bloomberg.net

To contact the editors responsible for this story: Courtney Dentch at cdentch1@bloomberg.net, Jeremy Herron, Andrew Dunn

©2018 Bloomberg L.P.