Traders work on the floor of the New York Stock Exchange. The Standard & Poor’s 500 Index erased this year’s losses as gains in oil and favorable shifts in central-bank policies support riskier assets. (Michael Nagle/Bloomberg)

After weeks of wild swings and dismal trading, U.S. stocks have reached a place that many feared would have been impossible this year: home base.

The Dow Jones industrial average, which tracks 30 blue-chip stocks, and the Standard & Poor’s 500-stock index, a broader view of the market, completed a slow slog into positive territory this week, erasing a nearly 10 percent collapse in prices that had sparked concerns of a year-long plunge into volatility that would have wiped out trillions of dollars in investor wealth.

Investors have become immune to some of the triggers that sparked panic early in the year and are clinging to positive economic signs, market analysts said. The price of oil, once lumbering below $30 a barrel, is now above $40. Concerns that China’s economic slowdown would seep into the rest of the global economy and destabilize the United States have waned. And the Federal Reserve this week left a key interest rate unchanged, giving investors confidence that the central bank would not be withdrawing support for the U.S. economy too quickly.

“We are nearly flat on the year. That is actually a big victory for investors. It’s a huge deal,” said Peter Kenny, senior market strategist for the Global Markets Advisory Group. “U.S. equities have managed to dig themselves out of a very big hole.”

The Dow and S&P rose modestly Friday. The Dow is up nearly 1 percent for the year, and the S&P is up about 0.4 percent.

But investors might not be out of the woods. The Nasdaq is down about 4 percent this year as investors remain skeptical of tech stocks. Some analysts also worry that U.S. companies will report weak first-quarter earnings, serving up another reason to fear that the U.S. economy is weaker than it appears. Besides, some say, presidential election years are typically volatile as investors adjust their views based on who is up or down in the polls.

“We could see volatility in the near term,” Kenny said.

“I think the real test is earnings season, which begins in April,” said Jack Ablin, chief investment officer of BMO Private Bank. “It will force investors to come face- to-face with lackluster earnings and revenues. We’ll see how we fare.”

And there are still warning signs in the initial-public-offering market. Only seven companies have gone public this year, compared with 28 in the same period last year, said Renaissance Capital, a manager of IPO-focused exchange traded funds.

[Billionaire Mark Cuban on why there aren’t many IPOs any more.]

And in many cases, the companies that have gone public have received substantial help from the venture capitalists and other insiders who helped fund them while they were private companies. Insiders typically own about 22 percent of a company’s public shares after an IPO, but that has reached 46 percent this year, according to Renaissance.

“These aren’t really public companies,” said Kathleen Smith, a principal at Renaissance Capital. Given the heavy participation of insiders, it is difficult to determine the true value of a company, she said. “The price discovery is limited and that makes [the companies] challenging and highly risky,” Smith said.

When Editas Medicine, a start-up gene-editing biotech, became the first IPO of 2016 on Feb. 3, it was good news for its heavy-
hitting roster of investors, including Bill Gates, Google and Fidelity Investments. Its stock, which has traded widely since its IPO, ranging from $13 to $42 a share, is up more than 60 percent this year.

But 67 percent of the shares Editas sold to the public have been bought by insiders, according to Renaissance Capital. “There was no indication of insider buying at the time of the IPO,” Renaissance said in a recent report. “Speculative trading in preclinical biotechs is nothing new, but Editas’ extreme volatility is further fueled by a deceptively low float.”

Editas declined to comment.

If the stock market remains strong and other recent IPOs continue to gain ground, the market could begin to thaw, Smith said.

“Once those things happen, we’re likely to see ice breakers,” she said. “It could start up slowly after Easter, assuming we’re in the same conditions we’re in now. Investors may be ready to crawl out of their bunkers.”