Stocks ended with moderate losses Tuesday as investors waited for the first debate between President Donald Trump and Democratic challenger Joe Biden.

Banks, energy companies and stocks that depend on consumer spending had some of the biggest losses. The price of oil fell 3.2%, dragging much of the energy sector down with it.

Some technology stocks, which have long been the biggest driver of this year’s stock market moves, posted gains.

On Monday:

The S&P 500 fell 16.13 points, or 0.5%, to 3,335.47.

The Dow Jones Industrial Average was down 131.40 points, or 0.5%, to 27,452.66.

The Nasdaq composite lost 32.28 points, or 0.3%, to 11,085.25.

The Russell 2000 index of small company stocks lost 5.62 points, or 0.4%, to 1,504.73.

For the week:

The S&P 500 is up 37.01 points, or 1.1%.

The Dow is up 278.70 points, or 1%.

The Nasdaq is up 171.68 points, or 1.6%.

The Russell 2000 is up 29.82 points, or 2%

For the year:

The S&P 500 is up 104.69 points, or 3.2%.

The Dow is down 1,085.78 points, or 3.8%.

The Nasdaq is up 2,112.64 points, or 23.5%.

The Russell 2000 is down 163.74 points, or 9.8%.