Stocks shook off early losses and closed higher Wednesday after Federal Reserve Chairman Alan Greenspan delivered an upbeat assessment of the economy and Wall Street focused on solid earnings reported by a growing number of companies.

The Nasdaq composite index and the Standard & Poor's 500 hit new four-year highs.

The market opened lower, as investors punished Intel and Yahoo after their earnings reports, issued following the close of regular trading Tuesday, fell below analysts' expectations. Stocks briefly slid further after Greenspan told Congress that the economy should enjoy sustained growth with low inflation in coming months, a sure sign incremental interest rate hikes would continue. But the sell-off didn't stick -- additional rate increases have long been expected.

The Dow Jones industrial average rose 42.59, or 0.4 percent, to 10,689.15. The Standard & Poor's 500-stock index rose 5.85, or 0.5 percent, to 1235.20, its best close since July 2, 2001. The Nasdaq composite index rose 15.39, or 0.7 percent, to 2188.57, moving into positive territory for the year and reaching its highest point since June 18, 2001.


Intel fell $1.27, to $27.44, after it reported strong earnings, but a gross margin below analysts' forecasts. Investors also ignored Yahoo's stellar earnings, instead focusing on how the results missed analysts' lofty expectations. The stock fell $4.33, to $33.40.

Amgen rose $10.65, to $81.17, after the biotech company's second-quarter earnings beat expectations and the company increased its already rosy financial outlook for the year.

Pfizer fell 32 cents, to $27.06, even though the drugmaker's second-quarter earnings gained 21 percent, beating analysts' expectations.

Wyeth rose $1.28, to $46.28, as the drugmaker's second-quarter profit climbed 18 percent.

J.P. Morgan Chase fell 5 cents, to $35.16. The bank reported a drop in trading revenue, but its earnings beat reduced analysts' projections.

United Technologies rose 9 cents, to $51.94, after the diversified manufacturing company said second-quarter profit rose 19 percent, beating analysts' expectations.


New York Stock Exchange composite index rose 38.84, to 7453.41.

American Stock Exchange index rose 4.54, to 1539.62.

Russell 2000 index of smaller-company stocks rose 8.70, to 677.56.


NYSE: 2.06 billion shares, up from 2.05 billion on Tuesday. Advancers outnumbered decliners 9 to 4.

Nasdaq: 1.98 billion shares, up from 1.65 billion. Advancers outnumbered decliners 2 to 1.


Crude oil for August delivery: $56.72, down 74 cents.

Gold for current delivery: $421.70 a troy ounce, up from $419.70 on Tuesday.