Stocks ended higher, recovering the most of their losses from the day before, as Greece appeared closer to resolving its latest debt problems. However, the overall market remains directionless as most investors are focused on figuring out when the Federal Reserve's long-awaited interest rate increase may come.

On Wednesday:

The Dow Jones industrial average rose 121.45 points, or 0.7 percent, to 18,162.99.

The Standard & Poor's 500 index closed up 19.28 points, or 0.9 percent, to 2,123.48.

The Nasdaq composite added 73.84 points, or 1.5 percent, to 5,106.59.

For the Week:

The Dow is down 69.03 points, or 0.4 percent.

The S&P 500 is down 2.58 points, or 0.1 percent.

The Nasdaq is up 17.23 points, or 0.3 percent.

For the year:

The Dow is up 339.92 points, or 1.9 percent.

The S&P 500 index is up 64.58 points, or 3.1 percent.

The Nasdaq is up 370.54 points, or 7.8 percent.