U.S. stocks struggled for direction Monday, unsure of what to make of news about Greece’s debt workout.

The Dow Jones industrial average and the Standard & Poor’s 500 ended the day higher, but the Nasdaq fell. Both indexes wavered between small gains and losses for the day. The Dow was the most stable, staying above Friday’s close for all but a few minutes.

advertisement | advertise on newsday

The Dow closed up 37.69 points at 12,959.71, its fourth straight day of gains and the second time that has happened this year. The Dow has now erased its nerve-racking 204-point loss last Tuesday, when investors sent stocks lower over concerns about Greece. The Dow’s trading range of 56.38 points was its narrowest in more than 11 months.

The S&P 500 was virtually unchanged, up 0.22 points to 1,371.09. The Nasdaq fell 4.68 points to 2,983.66.

“The market is going to continue to feel very schizophrenic,” said Carol Pepper, CEO and founder of Pepper International, a money management firm in New York. “Some days it’s depressed, some days it’s excited, some days it’s terrified.”

The news out of Europe clouded the market outlook. Greece persuaded private investors to agree to big losses on their bond holdings, which should help the country stave off default later this month. But the country is still in a severe recession, and debt burdens are brewing in Portugal and Italy.