Despite 39 million shares, about 18% of the total company, being sold in a block sale late Monday by Mr. Ackman’s fund Pershing Square, J.C. Penney is enjoying one of its best days of the year on Tuesday.

The stock hit as high as $13.90, a 4.1% gain. That would be the stock’s 17th best percentage gain of the year, according to FactSet. This while the broader market is falling, partly amid global concerns over war.

Typically, a major shareholder dumping that many shares into market isn’t good news for other investors, but in this case, the exit of the activist Mr. Ackman seems to be inspiring a bit of relief among shareholders.

“Longer term we view the decision of Pershing Square to part ways with JCPenney as potentially positive for the chain, as it will allow the company’s management and board to focus on fixing the ailing retailer in a more cohesive fashion,” Oppenheimer analysts wrote in a research report, summing up the general attitude.

Tuesday’s rally, however, isn’t entirely about kicking out the activist. The question of when Mr. Ackman would sell has weighed on the stock since he quit the board two weeks ago.

Oppenheimer had said the “primary concern” for the stock was the “new wave of shares hitting the market could further undermine an already weak stock price.” Citigroup said the sale would remove one of the overhangs it saw keeping the stock down.

Those concerns are now gone with thanks to Mr. Ackman’s quick sale.

As a picture of how it has been for J.C. Penney shareholders this year, the stock has risen in 74 sessions including today, while spending 90 days in the red, according to FactSet. One day in March the stock ended flat.

In comparison, the Dow Jones Industrial Average has gained in 95 sessions with today being the 70th day it has fallen, according to WSJ’s Market Data group. The S&P 500 has been up 97 days and today marks its 68th fall.

J.C. Penney has been positive only 20 times this year when the S&P 500 has fallen, according to FactSet. The stock has been negative during an S&P 500 rally 42 times.