Stocks on Wall Street closed with small gains Tuesday, avoiding a third straight decline for the market.

Technology and internet stocks led the winners, while industrial companies and consumer products makers lagged the market. Investors were looking ahead to the start on Wednesday of two days of congressional testimony by Federal Reserve Chair Jerome Powell.

On Tuesday:

The S&P 500 rose 3.68 points, or 0.1%, to 2,979.63.

The Dow Jones Industrial Average fell 22.65 points, or 0.1%, to 26,783.49.

The Nasdaq composite gained 43.35 points, or 0.5%, to 8,141.73.

The Russell 2000 index of smaller company stocks added 1.20 points, or 0.1%, to 1,562.59.

For the week:

The S&P 500 is down 10.78 points, or 0.4%.

The Dow is down 138.63 points, or 0.5%.

The Nasdaq is down 20.06 points, or 0.3%.

The Russell 2000 is down 13.04 points, or 0.8%.

For the year:

The S&P 500 is up 472.78 points, or 18.9%.

The Dow is up 3,456.03 points, or 14.8%.

The Nasdaq is up 1,506.45 points, or 22.7%.

The Russell 2000 is up 214.03 points, or 15.9%.