U.S. stocks closed narrowly mixed on Wednesday, as the Dow Jones Industrial Average closed at a new record amid firming oil prices, moderate housing data and some debate over Fed Chair Janet Yellen's congressional testimony.
"I think everybody's mulling what Janet Yellen said yesterday," said Kim Forrest, senior equity analyst at Fort Pitt Capital said.
The S&P 500 closed down 1.62 points, or 0.08 percent, to 2,113.86, after hitting a new intraday all-time high, with consumer discretionary leading all sectors and utilities the biggest loser.
The Nasdaq tried to touch the key 5,000 level, but failed to do so, closing 0.98 points down at 4,967.14. Apple closed down 3.38 points, or 2.56 percent, at $128.79 per share, off highs of $133 a share.
Yellen's remarks to the Senate on Tuesday were mostly dovish but added little weight on either side to analyst expectations on the timing of an interest rate hike.
Stocks briefly traded higher to new intraday highs after the Fed chair reiterated her remarks on Wednesday in front of the House Financial Services Committee.
"Markets have a history of rallying when (Yellen) speaks," said Randy Frederick, managing director of trading and derivatives at Charles Schwab. Stocks gained 12 of the last 13 times Yellen or the Federal Reserve made a major announcement prior to Wednesday's testimony, according to Frederick's historical analysis.
Stocks were little changed after morning housing data and earnings.
Peter Boockvar, chief market analyst at The Lindsey Group, said out in a note that the new home sales for January were "mediocre." The reported level was the best since the middle of 2008 but below the 30-year average of 710,000.
Read MoreFour ways to insure the record rally
The U.S. Energy Information Administration reported that weekly crude inventories rose 8.4 million barrels, more than expected. The figures were in-line with Tuesday's American Petroleum Institute report of 8.9 million barrels.
Crude oil futures settled up $1.71, or 3.47 percent, to $50.99 a barrel on the New York Mercantile Exchange, its best day since Feb. 12. Brent crude traded near $62 a barrel.
Mortgage applications to purchase a home rose 5 percent on a seasonally adjusted basis for the week ending Feb. 20 from the previous week, the Mortgage Bankers Association reported early on Wednesday.