Shares of Amazon.com Inc. charged higher Wednesday, putting them on track for the best five-day stretch in seven years, as they bucked a selloff in the broader market.

The stock AMZN, +2.73% ran up 2.4% in afternoon trading, enough to make it one of the top performers among S&P 500 index components.

After closing at a 2-year low of $2,082.00 on May 24, it has soared 18.3% amid a five-day win streak. That puts the stock on course for the best five-day performance since it shot up 18.5% during the five sessions through April 24, 2015.

The rally comes while the S&P 500 index SPX, -0.22% seesawed to a decline of 0.3%, after being up as much as 0.8% and down as much as 1.4% in intraday trading.

J.P. Morgan analyst Doug Anmuth reiterated the overweight rating he’s had on Amazon for at least the past three years, saying its stock (AMZN) remains his “best idea” in the internet space. He also maintained his stock price target at $4,000, which implies about 62% upside from current levels.

“We continue to believe revenue growth should reaccelerate in 2H22 as [year-over-year comparisons] ease and AMZN gains greater penetration in grocery, CPG [consumer packaged goods], apparel and accessories, and furniture/appliances/ equipment,” Anmuth wrote in a note to clients.

Morgan Stanley’s Brian Nowak also said Amazon was a top pick within the interest sector, and reiterated the bullish overweight rating he’s had on the stock for at least three years.

Although he cut his stock price target to $3,500 from $3,800, citing increasing uncertainty over broader economy and consumer spending, Nowak’s new target still implies about 42% upside. He said that upside speaks to how much “downturn fear” is already priced into the stock.

“We expect investors to return to blue-chip names like these first if/when inflation fears subside and the consumer (hopefully) hold on better than feared,” Nowak wrote.

Amazon’s stock has slumped 26.2% so far this year, while the SPDR Consumer Discretionary Select Sector exchange-traded fund XLY, -0.22%, of which it is a components, has dropped 24.7%. The S&P 500 index SPX, -0.22% has lost 13.6% this year.