Stocks rallied to record highs on Wall Street Wednesday on encouraging company earnings reports and continued optimism that new leadership in Washington will mean more support for the struggling economy.

The S&P 500, Dow Jones Industrial Average, Nasdaq composite and Russell 2000 small-caps index eclipsed their all-time highs set earlier this month. Gains in technology, communications, health care and most other sectors powered the rally.

Treasury yields rose. Netflix soared after passing 200 million subscribers.

On Wednesday:

The S&P 500 rose 52.94 points, or 1.4%, to 3,851.85.

The Dow Jones Industrial Average gained 257.86 points, or 0.8%, to 31,188.38.

The Nasdaq composite climbed 260.07 points, or 2%, to 13,457.25.

The Russell 2000 index of smaller companies picked up 9.48 points, or 0.4%, to 2,160.62.

For the week:

The S&P 500 is up 83.60 points, or 2.2%.

The Dow is up 374.12 points, or 1.2%.

The Nasdaq is up 458.74 points, or 3.5%.

The Russell 2000 is up 37.42 points, or 1.8%.

For the year:

The S&P 500 is up 95.78 points, or 2.6%.

The Dow is up 581.90 points, or 1.9%.

The Nasdaq is up 568.97 points, or 4.4%.

The Russell 2000 is up 185.76 points, or 9.4%.