U.S. equities rose on Thursday, putting the major indexes close to all-time highs, as investors parsed through economic data and Federal Reserve Chair Janet Yellen's testimony.
The Dow Jones industrial average closed about 35 points higher, with Home Depot and Goldman Sachs contributing the most gains. The blue-chips index closed lower on Wednesday, snapping a seven-day winning streak.
"There's a couple of things at play this week that keep the market in its trend," said Daniel Deming, managing director at KKM Financial. "Some of it has to do with options expirations. ... Also, that sector rotation has continued."
The S&P 500 rose 0.47 percent, with financials rising 1.25 percent to lead advancers. The Nasdaq composite outperformed, rising around 0.74 percent. The three major indexes were also less than half a percent away from hitting record highs.
Yellen, the head of the Federal Reserve, testified in front of Congress. In prepared remarks, Yellen said a rate hike could be "appropriate relatively soon," adding there are dangers to waiting too long to tighten monetary policy. Yellen also said she would not step down from her until her term is done.
A large number of market participants expect the central bank to raise interest rates next month. According to the CME Group's FedWatch tool, market expectations for a December rate hike were around 90 percent Thursday.
"Janet Yellen has further cemented the argument that a rate could take place next month. For us, it is a Done Deal and the question which we are focused on is if the Fed is sensitive to Treasury yields," Naeem Aslam, chief market analyst at Think Markets, said in a note. U.S. Treasury yields rose on Thursday, with the two-year note yield near 1.03 percent and the benchmark 10-year yield around 2.28 percent as of 3:23 p.m.