Who stands to win with the Standard & Poor’s 500 Index posting its biggest monthly advance since 2011? How about investors who started pumping money into the market as U.S. stocks bottomed in August and haven’t stopped since.

Clients of exchange traded funds sent a net $28 billion to ETFs tracking American equities since the S&P 500 hit a 10-month low on Aug. 25, data compiled by Bloomberg show. The trades are proving to be profitable amid a rally that in October amounted to the biggest monthly advance in four years. By contrast, investors pulled $3.7 billion out of funds in the 30 days leading up to October 2011, the last time the S&P 500 rallied more than 8 percent in a single month.

Almost $2 trillion in market value has been restored to U.S. stocks since the index suffered its first correction in four years. The S&P 500’s 12 percent rally in that time has been led by commodity producers that were beaten down in the third quarter. Global equities surged as central banks in Europe and China pledged more stimulus and the Federal Reserve refrained from boosting interest rates in October.

“People were using the selloff to buy the dip, which has obviously worked quite well,” said Stephen Solaka, managing partner of Belmont Capital Group in Los Angeles, which oversees about $275 million. “A lot of people had been in cash and were looking for a buying opportunity. ETFs are a pretty quick way, even intraday, for people to get exposure to the market and play a rebound.”

After stepping up withdrawals during the six-day rout that took the S&P 500 down by 11 percent, investors poured $13 billion into ETFs from Aug. 25 to the end of September, with the equity benchmark adding 2.8 percent in that time.

Traders kept adding to ETFs in the fourth quarter, undeterred by the worst three months for American stocks since 2011. Funds tracked by Bloomberg have seen an additional $15 billion of new capital since the start of October through Tuesday, as the S&P 500 has rallied 9.5 percent. The benchmark gauge slid 0.1 percent to 2,099.93 at 4 p.m. in New York.

While ETFs, popular destinations for retail investors looking for exposure to large swaths of the market, have swelled in size as the S&P 500 erased its loss for the year, hedge funds in the business of picking single stocks haven’t fared as well.

Greenlight Capital, the investment firm led by David Einhorn, has lost 16 percent in 2015, according to an e-mail sent to clients that was obtained by Bloomberg. Pershing Square Holdings, the publicly traded security of Bill Ackman’s activist hedge fund, extended annual losses last month to 19 percent as investments in Valeant Pharmaceuticals International Inc. and Platform Specialty Products Corp. tumbled.

What’s shaping up to be a forgettable year for some hedge fund managers has been a record period for ETF creation. More than 190 U.S. equity ETFs have started this year, a rate that already exceeds any full year since the annual peak of 212 in 2007, data compiled by Bloomberg show. The boom has been buoyed by a market that has seen consistent gains with few interruptions since 2011. The S&P 500 spent the first seven months this year trading in the tightest range ever.

“The reason people are creating them is because there’s demand,” said Steve Sosnick, an equity risk manager at Timber Hill, the market-making unit of Greenwich, Connecticut-based Interactive Brokers Group Inc. “That’s the product right now that people are looking for and feeling increasingly comfortable with.”