The Dow Jones industrial average notched its third record high close in a row Wednesday, even as other market indexes ended lower.
Trading was relatively subdued as investors reviewed the latest corporate earnings news. Utilities stocks were among the biggest decliners. Energy stocks rebounded as oil prices broke a five-day slide and climbed back above $50 a barrel.
Wall Street also kept an eye on Federal Reserve Chief Janet Yellen's second appearance before Congress in two days. Her remarks didn't generate any major market-moving news. A day earlier, Yellen suggested that the Fed is not in a hurry to raise interest rates.
"The market is just trying to figure out whether the next move is up or down," said David Lebovitz, global market strategist at J.P. Morgan Asset Management.
The Dow ended up 15.38 points, or 0.1%, to 18,224.57. McDonald's was the biggest gainer in the 30-company index, climbing 3.9%.
The Standard & Poor's 500 index slipped 1.62 points, or 0.1%, to 2,113.86. The Nasdaq shed 1 point, or 0.02%, to 4,967.14. The three indexes are all up for the year.
The Dow and S&P 500 closed at record highs on Tuesday after investors were encouraged Yellen's remarks on interest rates. Lower rates make borrowing easier and tend to be a plus for financial markets.
The Fed has kept its benchmark rate near zero since 2008. Most economists anticipate that a rate increase is not likely before June or even later this year.
A key factor in that decision will be inflation. That's one reason investors will be focused on the release of the latest consumer price index on Thursday.
"That should provide a little bit of insight on what the Fed's next move might be and when it may occur," Lebovitz said.
The three indexes opened lower on Wednesday, then veered between small gains and losses through much of the day. In the last hour of trading, the Dow eked out a gain.
Hewlett-Packard and Boston Beer slumped early. Both reported disappointing quarterly results late Tuesday. Hewlett-Packard tumbled 9.9%, while the brewer of Samuel Adams beer sank 10.3%. Chesapeake Energy and Lumber Liquidators also declined after reporting weak earnings early Wednesday. Chesapeake fell 9.6%, while the hardwood floors retailer slid 26.4%.
Investors bid up shares in several companies whose latest quarterly earnings fared better.
TJX, the parent company of T.J. Maxx and Marshalls, rose 3.3% after its profit beat analysts' expectations. The company also said would raise wages for its workers.
Benefitfocus vaulted 47.2%, while specialty contracting services company Dycom Industries surged 17%. Discount retailer Dollar Tree rose 2.2%.
In all, half of the 10 sectors in the S&P 500 moved lower. Utilities stocks fell 1.6% and are now down 4% this year. Consumer discretionary stocks notched the biggest gain. The sector is up 5.6% this year.
The price of oil rose after the Energy Department reported that diesel and gasoline inventories fell more than expected, indicating a pickup in demand. Benchmark U.S. crude rose $1.71 to close at $50.99 a barrel in New York. Brent crude, a benchmark for international oils used by many U.S. refineries, rose $2.97 to close at $61.63 in London.
In other futures trading on the NYMEX: Wholesale gasoline rose 9.9 cents to close at $1.719 a gallon, while heating oil rose 7.5 cents to close at $2.104 a gallon. Natural gas fell 0.8 cents to close at $2.894 per 1,000 cubic feet.
Gold rose $4.20 to $1,201.50 an ounce, silver rose 24 cents to $16.43 an ounce and copper rose two cents to $2.66 a pound.
U.S. government bond prices rose. The yield on the 10-year Treasury note slipped to 1.97% from 1.98% late Tuesday.