Stocks rose steadily throughout the day and ended with broad gains as traders got back to buying again after a mostly miserable few weeks on Wall Street.

Tech giants like Apple and Microsoft were among the biggest winners, and video game maker Take-Two Interactive jumped after forecasting better results than analysts were expecting. Paramount soared after Warren Buffett’s Berkshire Hathaway disclosed a new stake in the media company.

The S&P 500, the Dow Jones Industrial Average and the tech-heavy Nasdaq gained ground. Small-company stocks rose more than the rest of the market, a signal investors are feeling bullish on the economy. Treasury yields rose.

On Tuesday:

The S&P 500 rose 80.84 points, or 2%, to 4,088.85.

The Dow Jones Industrial Average rose 431.17 points, or 1.3%, to 32,654.59.

The Nasdaq rose 321.73 points, or 2.8%, to 11,984.52.

The Russell 2000 index of smaller companies rose 56.87 points, or 3.2%, to 1,840.30.

For the week:

The S&P 500 is up 64.96 points, or 1.6%.

The Dow is up 457.93 points, or 1.4%.

The Nasdaq is up 179.52 points, or 1.5%.

The Russell 2000 is up 47.63 points, or 2.7%.

For the year:

The S&P 500 is down 677.33 points, or 14.2%.

The Dow is down 3,683.71 points, or 10.1%.

The Nasdaq is down 3,660.45 points, or 23.4%.

The Russell 2000 is down 405.01 points, or 18%.