The Dow and the Standard & Poor's 500 index closed at 13-month highs on Wednesday as an upbeat forecast from a top homebuilder and data from China pointed to a strengthening global economy.

The Dow's advance was its sixth straight as comments from top Federal Reserve officials suggesting low interest rates will stay for some time added to the positive tone.

Luxury homebuilder Toll Brothers Inc late Tuesday forecast revenue that was sharply higher than expected, lifting the Dow Jones homebuilders index <.DJUSHB> 7.1 percent. Toll jumped 16.4 percent to $21.41.

Data before the open showed Chinese factory output rose to a 19-month high in October. Investors bet the data heralded growing demand in the world's third-largest economy.

There was fairly bullish news coming from China with respect to its industrial production, which has exerted upward pressure on commodities and commodity-related stocks, said Matt Kaufler, portfolio manager and equity analyst at Clover Capital Management in Rochester, New York.

After the closing bell, shares of network equipment maker 3Com Corp rose 34 percent to $7.64 after Hewlett-Packard Co said it agreed to buy 3Com for $2.7 billion.

The Dow Jones industrial average <.DJI> was up 44.29 points, or 0.43 percent, at 10,291.26. The Standard & Poor's 500 Index <.SPX> was up 5.50 points, or 0.50 percent, at 1,098.51. The Nasdaq Composite Index <.IXIC> was up 15.82 points, or 0.74 percent, at 2,166.90.

The Hewlett-Packard announcement could give investors reason to extend the stock market's gains.

The technology sector is where the concentration of deal flow is, and it seems to me that might be supportive of the market at this juncture, Rob Stein, managing partner of Astor Asset Management in Chicago, said.

During the regular session, shares of Wal-Mart , up 1.3 percent at $52.97, gave the biggest lift to the Dow, which recorded its longest winning streak since August.

The Dow has risen 57 percent from its 12-year closing low hit on March 9.

Volume was light due to the Veterans Day holiday. Federal offices and the U.S. bond market closed for the day.

Fed comments from Tuesday that the U.S. recovery would be bumpy bolstered the view that rates will stay low and economic stimulus will remain intact, a boon for stocks.

Dragging on the market, Macy's Inc , the department store operator, tumbled 8.1 percent to $17.86 after the company gave a gloomy outlook on same-store sales for the fourth quarter.

Also after the close shares of Applied Materials rose 2.1 percent to $13.53 after the company reported quarterly results.

Volume was below average on the New York Stock Exchange, with 1.05 billion shares changing hands, down from last year's estimated daily average of 1.49 billion, while on the Nasdaq, about 1.88 billion shares traded, below last year's daily average of 2.28 billion.

Advancing stocks outnumbered declining ones on the NYSE by a ratio of 19 to 11, while advancing stocks beat decliners on the Nasdaq by about 8 to 5.

(Additional reporting by Leah Schnurr and Ryan Vlastelica; Editing by Kenneth Barry)