Stocks gained 1 percent on Tuesday as stronger-than-expected data from overseas sparked buying before a keenly awaited speech by Federal Reserve Chairman Ben Bernanke this week.

Other data on Tuesday showed the U.S. housing sector weaker than expected. It was the latest in a string of discouraging reports that some investors speculate will spur the Fed to take stimulative measures.

The data today has raised hopes about the Fed's actions and after four straight days of losses and a flat market yesterday, people are willing to jump at buying opportunities, said Larry Peruzzi, senior equity trader at Cabrera Capital markets in Boston.

The Dow Jones industrial average was up 120.91 points, or 1.11 percent, at 10,975.56. The Standard & Poor's 500 Index was up 13.68 points, or 1.22 percent, at 1,137.50. The Nasdaq Composite Index was up 37.06 points, or 1.58 percent, at 2,382.44.

Reports on China's factory sector and German business activity pointed to slowing growth but weren't as weak as some had feared.

Early trading was volatile, with the steep gains before the market's open quickly eroding. Then stocks rallied after the U.S. home sales data. However, some questioned whether trading could follow Monday's path in which early advances ended with only modest market gains.

These pockets of good news from Asia and Europe suggest that the wave of bad news that had been expected isn't coming forth like people had been worried about, said Andrew Wilkinson, senior market analyst at Interactive Brokers Group in Greenwich, Conn.

New U.S. single-family home sales fell more than expected in July to hit a five-month low.

Volatility continues to plague markets before Bernanke speaks at the Fed's annual central bank conference in Jackson Hole, Wyoming, on Friday.

Some have speculated Bernanke could unveil measures to revive a struggling U.S. economy, though he's most likely to outline gradual actions, which would likely disappoint those seeking something dramatic like a third round of quantitative easing.

Bank of America Corp., after signaling gains before the bell, sank 1.1 percent to $6.35.

UBS AG plans to slash around 3,500 jobs in a cost-cutting measure. U.S.-listed shares rose 3.3 percent to $13.63.

(Editing by Kenneth Barry)