Stocks close higher despite Greece; Dow up triple digits

U.S. stocks closed up about 1 percent on Tuesday as investors shook off early negative news out of Greece on hopes of a resolution.

Art Hogan, chief market strategist at Wunderlich Securities, said markets were breathing a "sigh of relief over Greek drama."

The major indices closed in the black for the year, with the Nasdaq leading gains with a 1.09 percent year-to-date gain.

The Dow Jones Industrial Average recovered to trade by as much as more than 150 points higher after falling to single-digit gains on Tuesday morning reports that said the German Finance Minister would not agree to a new Greek debt program on Wednesday.

Also boosting the Dow, Coca-Cola gained about 3 percent after posting earnings of an adjusted 44 cents per share for the fourth quarter, two cents above estimates, with revenue above forecasts as well. Global case volume was roughly in line with estimates.

"Europe sold off on those headlines and came back" to close higher, said Peter Boockvar, chief market analyst at The Lindsey Group. "People still think there's going to be a Greek deal."

Jens Weidmann, head of Germany's Bundesbank, held to an austerity line and told Reuters on Tuesday that Greece needed to make a credible effort to recover itself with tighter public finances and economic reforms.

"Right now we're a bit hostage to the Greek debate and how other countries might unravel their relationship with the (European Union)," said Mark Luschini, chief investment strategist at Janney Montgomery Scott.

Read MoreGreece needs to play by the rules: France

Investors are watching closely for a possible Greek debt deal when the euro group of finance ministers meets in Brussels on Wednesday where Greece's Finance Minister Yanis Varoufakis is expected to detail new reform proposals.

The Greek newspaper Ekathimerini reported late on Monday a preview from government officials for a proposal that would create a bridge program with creditors in September.

"This (discussion) is going to be pushed on and on and on," said Martin Schulz, head of PNC Capital Advisors' International Equity Fund. He said Greece would probably stay in the European Union.

Read MoreGreeks soften tone as Germans stand firm

Futures touched session highs on speculation that the European Commission could be ready to table a compromise on Greece's bailout program and propose a six-month extension to the country's bailout which is due to end on February 28. The Athens stock exchange was trading up about 8 percent on Tuesday.

The German Finance Minister Wolfgang Schaeuble later said the speculation was "wrong," Bloomberg reported.

Concerns over the Greek debt negotiations continue to weigh on market sentiment. Speaking from Washington, German Chancellor Angela Merkel said she was looking for a "viable recommendation" from Greece on Monday, after Prime Minister Alexis Tsipras reiterated his pledge to end Greece's current bailout Sunday.

Read MoreNew ideas: So go financials, so goes S&P?

Greek concerns sent U.S. stocks lower to close in the red on Monday, despite oil settling higher. On Tuesday, stocks also broke a strict correlation to crude.

Crude oil futures settled down $2.84 at $50.02 a barrel on the New York Mercantile Exchange. Gold futures closed down $9.30, or about 0.50 percent, at $1,232.20 an ounce in Tuesday's session.

Oil resumed its plunge on Tuesday as the International Energy Agency warned oil stocks could reach all-time highs this year. "Despite expectations of tightening balances by end-2015, downward market pressures may not have run their course just yet," the IEA said in a monthly report.

Halliburton also confirmed Tuesday afternoon it would cut 6 to 8 percent of its workforce, citing the recent plunge in oil prices. Pavel Molchanov, energy analyst at Raymond James, told CNBC's "Power Lunch" there will be more layoffs in the oil sector. "When companies that are actually producing the oil are cutting spending by, in some cases, 80 percent, there is no way to avoid widespread layoffs," he said.

The Dow Jones Industrial Average closed up 139.5 points, or 0.79 percent, at 17,868.76, with Pfizer and Coca-Cola leading gains, and Caterpillar the greatest laggard.

The S&P 500 closed up 21.85 points, or 1.07 percent, at 2,068.59, with utilities leading all sectors higher except energy.

The Nasdaq closed up 61.63 points, or 1.30 percent, at 4,787.64.

The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded near 17.

About nine stocks advanced for every seven decliners on the New York Stock Exchange, with an exchange volume of 772 million and a composite volume of 3.9 billion in the close.

High-frequency trading accounts for about 47.5 percent of trade volume this year, down from a peak of 61 percent in 2009, according to TABB Group estimates.

The U.S. dollar gained against major world currencies.

Symbol
Name
Price
 
Change
%Change
DJIA
---
S&P 500
---
NASDAQ
---

The National Federation of Independent Business reported that U.S. small business optimism fell 2.5 points to 97.9 in January amid worries over the near-term outlook, but a strengthening labor market should keep the economy on solid ground early in the year.

The decline reversed December's gains, which had taken the index over the 100 threshold for the first time in eight years.

Wholesale Sales for December showed an increase in inventories by 0.1 percent, below expectations, and a decline in sales of 0.4 percent. The nearly flat figures are the latest suggestion, after the fourth-quarter greater-than-expected trade deficit, that fourth-quarter GDP could be revised lower.

Job openings in December rose above 5 million for the first time since January 2001, marginally higher than openings in November. The hiring rate improved to 3.5 percent, up from 3.3 percent in November.

"Bottom line, this data point adds to the argument that the excess supply of workers that the Fed has been banking on is just not there," Peter Boockvar, chief market analyst at The Lindsey Group, said in a note. He expects removal of "patient" from the Fed's March statement and a rate hike most likely in June.

Read MoreHigher rates about to wreck these stocks

The President of the Federal Reserve Bank of Richmond Jeffrey Lacker said Tuesday morning that June 'looks like the attractive option' for raising rates.

In an exclusive interview with the Financial Times on Tuesday, the President of the Federal Reserve Bank of San Francisco, John Williams, said rate hikes are "closer and closer."

Both officials are voting members of the FOMC, with Lacker a hawk and Williams a moderate.

Last Friday's strong jobs report boosted overall economic sentiment. The U.S. 10-year Treasury yield traded near 2 percent on Tuesday, up from 1.6 percent levels last week.

"This ongoing strength is a testament to the U.S. economy and monetary policy coming in the middle of this year," Hogan said. "For the first time (the Fed) has signs on both fronts—jobs and wage price pressure."

Apple rose on Tuesday to become the first company to close with a market cap above $700 billion.

UBS, the biggest Swiss bank, doubled its full-year dividend to mark its biggest payout since the credit crisis Tuesday, but warned the Swiss franc's strength could hit future profits. Shares of the bank were trading 2 percent lower in Europe following the results.

Starwood Hotels earned an adjusted 97 cent per share for its latest quarter, well above estimates of 76 cents, and also announced plans to spin off its timeshare business.

Regeneron Pharmaceuticals reported adjusted quarterly profit of $2.79 per share, three cents short of estimates, though revenue exceeded analyst forecasts. Regeneron did see strong demand for its eye drug Eylea.

Reynolds American reported that fourth-quarter profit fell 49 percent on pension charges and other costs.

Dean Foods, the largest U.S. milk processor, reported lower-than-expected quarterly sales and profit as raw milk prices remained stubbornly high.

KKR reported a much higher-than-expected 89 percent year-on-year drop in fourth-quarter profit on Tuesday, making it the latest alternative asset manager to report lower earnings as a result of the plunge in oil prices.

Martin Marietta broke through its 200-day moving average to gain as much as 12 percent after posting earnings that beat and authorizing a 20 million share buyback program. The stock is on track for its best one-day gain since December 2008, when it rose 15.15 percent.

CNBC's Jenny Cosgrave and Reuters contributed to this report.

On tap this week:

Tuesday

Earnings: Akamai

Wednesday

Earnings: Mondelez Intl., PepsiCo, TimeWarner, Lorillard, Mosaic, Thomson Reuters, AOL, Generac, Baidu, Cisco Systems, MetLife, Applied Materials, CenturyLink, NetApp, Nvidia, Sun Life Financial, Tesla Motors, TripAdvisor, Whole Foods, Cheesecake Factory, FireEye, Panera Bread, Pilgrim's Pride, Select Comfort

7:00 a.m.: Mortgage applications

8:00 a.m.: Fed's Fischer speaks

10:30 a.m.: Oil inventories

1:00 p.m.: 10-year note auction

2:00 p.m.: Treasury budget

Thursday

Earnings: Total, Advance Auto Parts, Credit Suisse, Dr Pepper Snapple, Hospira, Kellogg, McGraw-Hill Financial, Nielsen, Avon Products, AIG, CBS, DaVita, Digital Realty Trust, Kraft Foods, Republic Services, Groupon, King Digital, Regal Entertainment, Shutterfly, Zynga

8:30 a.m.: Jobless claims

8:30 a.m.: Retail sales

10:00 a.m.: Business inventories

10:30 a.m.: Natural gas inventories

10:30 a.m.: Draghi speaks in Brussels

1:00 p.m.: 30-year bond auction

4:30 p.m.: Fed balance sheet/money supply

Friday

Earnings: ArcelorMittal, Brookfield Asset Management, J.M. Smucker

8:30 a.m.: Import and export prices

10:00 a.m.: Consumer sentiment

More From CNBC.com: