Stocks extended gains on Wednesday after data showed new orders for factory goods rose more than expected in July.

The Dow Jones industrial average <.DJI> gained 126.62 points, or 1.10 percent, to 11,686.57. The Standard & Poor's 500 Index <.SPX> added 14.72 points, or 1.21 percent, to 1,227.64. The Nasdaq Composite Index <.IXIC> rose 26.55 points, or 1.03 percent, to 2,602.66.

Equities earlier rose on continued hopes of more Federal Reserve stimulus for the struggling economy a day after minutes of the latest central bank meeting were published.

The S&P 500 was still on track for its worst month since May 2010. After the United States credit rating was downgraded in early August, the index posted one of its worst weeks since the depths of the financial crisis in 2008.