By Kate Gibson NEW YORK -- U.S. stocks tallied mild gains Wednesday afternoon, even as another round of weak economic data illustrated the rough economic recovery. "We'll have to figure how much is priced in with the carnage we've already done to the three major indexes," said Art Hogan, chief market strategist at Jefferies & Co. Down 100 points earlier in the session, the Dow Jones Industrial Average (DJI) briefly dipped below the 10,000 level for a second day, having finished the past four sessions with losses. Lately, the blue-chip benchmark was up 17.64 points to 10,058.09. Seventeen of the Dow's 30 components were on the rise, with home-improvement retailer Home Depot Inc. (HD) faring the best, its shares up 2.2%. Also down the past four sessions, the S&P 500 (SPX) was lately up 3.19 points to 1,055.06, with consumer-discretionary shares leading gains among its 10 industry groups. Notable movers included luxury home builder Toll Brothers Inc. (TOL), its shares up 5.7% after it swung to a third-quarter profit. . The results helped lift other housing stocks, with shares of D.R. Horton Inc. (DHI) up 4.8% and KB Home (KBH) gaining 5.4%. After a two-day losing streak, the Nasdaq Composite (RIXF) also reversed course, up 13.48 points to 2,137.24. For every seven stocks falling, eight were rising on the New York Stock Exchange, where 712 million shares traded as of 3 p.m. Eastern. On the New York Mercantile Exchange, gold futures added $7.90 to $1,241.30 an ounce, while crude-oil futures gained 89 cents to end at $72.52 a barrel. The major stock indexes pared their steep slide after data showed that new-home sales fell 12.4% in July to an annual rate of 276,000, a record low. . "The market quickly reversed course, however, with the thinking that new-home sales, while at record lows, can't really get much worse, and a bottom may be at hand," said analysts at Action Economics. Before Wall Street's open, the government reported that orders for durable goods climbed a meager 0.3% in July, an increase far less than anticipated. . "Orders for things that last three years fell off the cliff in the month of July," said Hogan. "It's another clear reflection of the softness of the U.S. economy."