Stocks hung on to gains, although they were fading late in the session.
By close of trading, the Dow Jones industrial average added 78.56 points or 0.6 percent to 13,248.44.
The tech-heavy Nasdaq index gained 35.34 points or 1.18 percent to 3,022.30. The Standard and Poor's 500 added 9.29 points or 0.65 percent to 1,427.84.
On the New York Stock Exchange, 2,069 stocks advanced and 978 declined on a volume of 3.6 billion shares traded.
Investors shrugged off a trade deficit report. The Commerce Department said the trade gap widened from $40.2 billion to $42.2 billion in October.
The 10-year treasury note fell 11/32 to yield 1.659 percent.
The euro rose to $1.3008 from Monday's $1.2941. The dollar rose to 82.50 yen from 82.36 yen.
Japan's Nikkei 225 index lost 0.09 percent, 8.43 points, to 9,525.32.
Britain's FTSE 100 index gained 0.06 percent, 3.34 points, to 5,924.97.
2014: The Year in Music [PHOTOS]