Stocks closed mostly higher on Wall Street Tuesday, nudging the S&P 500 and Nasdaq to all-time highs for the second straight day.

Health care companies, retailers and banks rose. Technology stocks fell after federal regulators said they are ramping up a probe into Microsoft and other tech giants.

On Tuesday:

The S&P 500 index rose 5.66 points, or 0.2%, to 3,357.75.

The Dow Jones Industrial Average slipped 0.48 points, or less than 0.1%, to 29,276.34.

The Nasdaq composite gained 10.55 points, or 0.1%, to 9,638.94.

The Russell 2000 index of smaller company stocks picked up 9.85 points, or 0.6%, to 1,677.51.

For the week:

The S&P 500 is up 30.04 points, or 0.9%.

The Dow is up 173.83 points, or 0.6%.

The Nasdaq is up 118.43 points, or 1.2%.

The Russell 2000 is up 20.74 points, or 1.3%.

For the year:

The S&P 500 is up 126.97 points, or 3.9%.

The Dow is up 737.90 points, or 2.6%.

The Nasdaq is up 666.34 points, or 7.4%.

The Russell 2000 is up 9.05 points, or 0.5%.