Stocks held big gains through Wednesday morning, trading at all-time highs, as investors rejoiced over the Federal Reserve's apparent faith in the U.S. economy. 

The S&P 500 was up 1%, the Dow Jones Industrial Average added 1.2%, or 241 points, and the Nasdaq increased 0.9%. The indexes were trading at intraday records.

The Dow exceeded 21,000 for the first time in history on Wednesday, having reached 20,000 in late January. It took only 24 days to move from 20,000 to 21,000, the fastest move between milestones since the Dow moved from 10,000 to 11,000 in 1999. 

"A modest correction would be perfectly normal, but the positive thing about this move is it has been driven by improving earnings," said Ryan Detrick, senior market strategist at LPL Financial. "This helps justify the gains, as it isn't all based on hopes for tax reform or infrastructure spending. There is real economic improvement now that has sparked much of the rally."

The chances of a rate hike in March grew overnight after New York Federal Reserve President William Dudley said the case for a rates increase had become a "lot more compelling" recently. In comments to CNN, Dudley said "most of the data we've seen over the last couple months is very much consistent with the economy continuing to grow at an above-trend pace, job gains remain pretty sturdy, inflation has actually drifted up a little bit as energy prices have increased."

A turn toward a more hawkish Fed in recent months has boosted Wall Street's confidence in the economy. Fed minutes from the January-February meeting said another rate hike would come "fairly soon." The Fed next meets on March 14-15.

If you liked this article you might like

This Is How to Avoid Becoming Amazon Roadkill

Wall Street Overlooks Trump's North Korea Threats to Hit New Records

Best Buy Disappointment Sends Retailers Into a Spin