Stocks bounced up and down Tuesday as retailers, energy companies and banks recovered some of their losses from the day before, but technology companies struggled as Facebook dropped again.

On Tuesday:

The S&P 500 index picked up 4.02 points, or 0.1 percent, to 2,716.94.

The Dow Jones industrial average climbed 116.36 points, or 0.5 percent, to 24,727.27.

The Nasdaq composite added 20.06 points, or 0.3 percent, to 7,364.30.

The Russell 2000 index of smaller-company stocks slid 0.16 points to 1,570.41.

For the week:

The S&P 500 is down 35.07 points, or 1.3 percent.

The Dow is down 219.24 points, or 0.9 percent.

The Nasdaq is down 117.69 points, or 1.6 percent.

The Russell 200 is down 15.64 points, or 1 percent.

For the year:

The S&P 500 is up 43.33 points, or 1.6 percent.

The Dow is up 8.05 points, or less than 0.1 percent.

The Nasdaq is up 460.91 points, or 6.7 percent.

The Russell 2000 is up 34.89 points, or 2.3 percent.