Traders said the rally was a continuation of Tuesday's advance, which came after Fed chairman Ben Bernanke signaled to lawmakers that the central bank's easy money policies would remain in force. Bernanke reiterated his argument Wednesday that the Fed's bond-buying program, known as QE, has helped the economy.
"There's nothing specific to cite," said Dan Greenhaus, market strategist at BTIG in New York. "But if you had to pin it to something, it would be Bernanke saying QE will continue in an environment of improving economic data."
Stocks have been pulling back lately, after a strong start to the year. All three indexes are still up between 6% to 7% so far this year.
Investors also cheered further signs of strength in the housing market.
A realtors group said Wednesday that pending home sales rose in January to the highest level since April 2010. The pending home sales data came one day after reports on home prices and sales came in better than expected.
Homebuilder stocks rallied Wednesday, with shares of Hovnanian(HOV) jumping 5%, leading rivals Toll Brothers(TOL), DR Horton(DHI) and Lennar(LEN).
The housing data overshadowed a mixed report on new orders for long-lasting goods.
The U.S. Census Bureau said durable goods orders dropped $11.8 billion, or 5.2%, in January. This was a steeper decline that the decrease of 3.5% projected by economists. However, excluding transportation, new orders would have increased 1.9%.
Investors were also encouraged by a successful auction of €6.5 billion in Italian government bonds. Wednesday's bond That helped push European markets higher. Italy has been a concern for investors since elections over the weekend raised concerns about the government's commitment to economic reforms.
Apple shareholders did not vote on a controversial proposal that would have limited the company's ability to issue preferred stock. Hedge fund manager David Einhorn, who had launched an activist campaign to unlock some of Apple's $137 billion cash hoard. Apple will put that to a vote at a later date.