The Dow Jones industrial average closed up 89.64 points, or 0.79 percent, at 11,502.51. The Nasdaq composite was up 20.49, or 0.87 percent, to 2,382. The Standard and Poor's 500 climbed 20.25 points, or 0.82 percent, and closed at 1,281.66.
Stocks got a boost from generally upbeat data during the day, especially the report on orders for durable goods increasing 1.3 percent last month to a seasonally adjusted $219.26 billion.
Crude futures gained $2.05 to reach $118.32 a barrel at the New York Mercantile Exchange, still watching storm warnings in the Gulf of Mexico. Tropical Storm Gustav slammed Haiti, killing 11, and moved toward the gulf, drawing comparisons to Hurricane Katrina. The gulf is home to one-quarter of U.S. crude production.
The dollar was mixed. The euro rose to $1.4710 compared to $1.4645 late Tuesday. Against the Japanese currency, the dollar rose to 109.65 yen from 109.64 yen.
Treasury prices were also mixed. The 10-year note was unchanged, yielding 3.776 percent.
Overseas, Tokyo's Nikkei 225 closed down 0.2 percent at 12,752.96 and London's FTSE 100 was up 1.1 percent at 5,528.10.