The Dow and the S&P 500 rose modestly in volatile trading on Wednesday, as equities bounced around on heightened uncertainty surrounding Federal Reserve Chairman Ben Bernanke's speech to central bankers on Friday.

The market's swings came a day after the three major U.S. stock indexes rallied 3 percent to 4 percent on hopes that Bernanke would hint at possible stimulus measures to aid the struggling economy.

Sectors that led Tuesday's rally, such as energy and technology, shed gains. Growth stocks such as Nvidia and Netflix slid.

Retailers and banks, however, gained ground. Dow component Home Depot shot up 3.5 percent to $34.28, while the KBW Bank Index climbed 1.8 percent.

I think after a run-up like yesterday, a little bit of choppy action is not surprising, said Frank Gretz, market analyst and technician at Shields & Co., a brokerage in New York. People are buying value stocks, so the uptrend is still intact.

This kind of choppy action is what you're going to have to live with for a while, he said. When the selling is out of the way, there's no more sellers left, so they (stocks) go back up.

The S&P financials index advanced 1.4 percent, with JPMorgan Chase & Co shares up 1.8 percent at $35.40.

Bank of America Corp rose 9.8 percent to $6.92, reversing losses on Tuesday, when the Dow component hit a 2-1/2-year low on fears it may have to raise large amounts of capital. BofA shares remain down more than 30 percent so far this month.

Equity indexes rose as much as 1 percent earlier after a stronger-than-expected increase in July durable goods orders, but then gave up those gains by late morning. Traders remained on tenterhooks over whether Bernanke would announce concrete Fed action or simply outline gradualist measures.

The Dow Jones industrial average advanced 20.78 points, or 0.19 percent, to 11,197.54. The Standard & Poor's 500 Index rose 3.10 points, or 0.27 percent, to 1,165.45. The Nasdaq Composite Index fell 5.93 points, or 0.24 percent, to 2,440.13.

Exchange-traded funds tracking gold stocks and gold-mining stocks fell after bullion futures dropped more than 4 percent. The SPDR Gold Trust Index declined 3.7 percent, while the Market Vectors Gold Miners Index fell 4 percent.

Among individual decliners, Barrick Gold shares dropped 4.3 percent to $48.49, Goldcorp Inc shares fell 5.3 percent to $48.58 and Kinross Gold shares lost 3.4 percent to $16.48.

The government reported that new orders for long-lasting U.S. manufactured goods surged in July, rising double the amount economists had forecast.

(Reporting by Ashley Lau; Editing by Jan Paschal)