U.S. stocks closed up on Tuesday at highs after encouraging reports out of Greece sent the S&P 500 to a record. "The market was never really all that afraid of Greece pulling out of the euro," said Peter Cardillo, chief market economist at Rockwell Global Capital.
He noted that the "safe haven trade is put to the sidelines," with the 10-year note yield gaining several basis points to as high as 2.15 percent as stocks reached records. Greece intends to ask for an extension of its loan agreement with the euro zone on Wednesday, a source in Brussels said , distinguishing this from the country's full bailout program. Stocks turned positive in early afternoon trade on the news, after earlier trading along the flat line just below multi-year highs despite the lack of resolution on Monday in the Greece-euro zone standoff. The Dow Jones Industrial Average (Dow Jones Global Indexes: .DJI) closed up 28.23 points, or 0.16 percent, to 18,047.58, with American Express (AXP) leading gains and McDonald's (MCD) the greatest laggard. The S&P 500 (^GSPC) closed up 3.35 points, or 0.16 percent, to 2,100.34, the index's second record close for the year. Health care led five sectors higher, while consumer discretionary was the greatest laggard.
The Nasdaq (^IXIC) closed up 5.43 points, or 0.11 percent, at 4,899.27, off slightly from its record close of 5,048.62 in March 2000. U.S. markets were closed on Monday for the Presidents' Day holiday.
U.S. stocks closed near highs on Friday, with the S&P setting its first record for 2015 at 2,096.99 and the Dow Jones industrial average above 18,000 for the first time since December.
Prime Minister Alexis Tsipras said on Tuesday that his Syriza party would not compromise with the euro zone on terms that he called "blackmail." On Monday, Greece failed to come to a settlement over a proposal for a six-month extension of its international bailout package.
"I think the biggest thing is the market is not worried about Greece talks," said Doug Cote, chief market strategist at Voya Investment Management,. "Greece has the most to lose. They have more incentive to get it done." Read More Is the Greek PM on collision course with Europe? On Wednesday, the European Central Bank will discuss Greek banks' use of emergency liquidity assistance (ELA)-and after which the ECB may give more clarity as to when or whether it will put a cap on its funding for Greek banks. "The underlying assumption in the market place is that something will get done, albeit in the 11th hour," said Art Hogan, chief market strategist at Wunderlich Securities.
European shares closed mixed on Tuesday , with the Athens Stock Exchange down about 2.5 percent as banks weighed heavily on the index. Oil prices continued to firm, with crude settling up 75 cents to $53.53 a barrel on the New York Mercantile Exchange. "We don't need it to go up or down, we just need it to stabilize," said Randy Frederick, managing director of trading and derivatives at Charles Schwab.
Read More Why we need a currency rule in trade deal In other overseas news, fighting intensified in eastern Ukraine past the agreed deadline of a cease-fire with Russia on Sunday.
The New York Fed's Empire State general business conditions index fell in February to 7.78 from January's reading of 9.95. Although the reading missed expectations, Cote said it was "pretty good" and "could have been a lot worse." The NAHB housing market indices showed U.S. home builder sentiment fell 2 points , largely due to the frigid weather, the National Association of Home Builders said on Tuesday.
December's TIC capital flows data comes at 4:00 p.m. ET.
Read More Early movers: HOT, MDT, WWW, WM, Z, AAPL & more Medtronic (MDT) reported earnings that beat on both the top and bottom lines, noting that the results were above the firm's own forecast.
Transocean (RIG)'s CEO Steven Newman stepped down and will be replaced on an interim basis by chairman Ian Strachan. The oilfield services company also slashed its annual dividend by 80 percent, to 60 cents per share from the prior $3. Agilent (NYSE:A), Analog Devices (ADI), CF Industries (CF), Devon Energy (DVN), Fossil (FOSL) and FirstEnergy (FE) are among the firms reporting after the bell. Investors will also be looking ahead to Wednesday, which brings industrial data and the minutes from the Federal Open Market Committee's most recent policy-setting meeting.
With "Fed minutes tomorrow and other economic data, (we're) poised to move even higher in the days ahead," Cardillo said. Decliners were a step ahead of advancers on the New York Stock Exchange, with an exchange volume of 780 million and a composite volume of 3.3 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.
Read More A Fed rate hike is coming-the question is when The CBOE Volatility Index (VIX) (^VIX), widely considered the best gauge of fear in the market, traded near 16. The U.S. 10-year Treasury note yield rose to 2.15 percent. The U.S. dollar edged lower against major world currencies. Gold futures settled down $18.50 to $1,208.60 an ounce. -CNBC.com and Reuters contributed to this report.
On tap this week: Tuesday Earnings: Agilent, Analog Devices, CF Industries, DevonEnergy, Jack in the Box, La-Z-Boy Wednesday Earnings: Actavis, Duke Energy, Garmin, Hyatt, Yandex, Fidelity National Financial, Fluor, Marathon Oil, Marriott 7:00 a.m.: Mortgage Applications 8:30 a.m.: Housing Starts 8:30 a.m.: PPI 9:15 a.m.: Industrial Production 2:00 p.m.: Fed Minutes Thursday Lunar New Year Earnings: Priceline, Wal-Mart, DirecTV, Discovery Comm., Goldcorp, Hormel Foods, Noble Energy, Con Edison, Intuit, Marvel Tech., Newmont Mining, Nordstrom 8:30 a.m.: Jobless Claims 9:45 a.m.: PMI Manufacturing Index Flash 10:00 a.m.: Philadelphia Fed Survey 10:00 a.m.: Leading indicators 10:30 a.m.: Natural gas inventories 11:00 a.m.: Oil inventories 4:30 p.m.: Fed Balance Sheet/Money Supply Friday Earnings: Cabot Oil & Gas, Deere 10:00 a.m.: Atlanta Fed Business Inflation Expectations More From CNBC.com: Greece: The final countdown 3 of the worst millennial money habits 'Get out of bonds,' strategist says