More Videos:

Yellen Testimony Spurs Stock Markets' Four-Day Winning Streak

Tickers in this article: RAX S ^DJI ^GSPC ^IXIC

NEW YORK (TheStreet) -- Benchmark U.S. stock indices closed higher for the fourth consecutive session Tuesday as Federal Reserve Chairwoman Janet Yellen underscored in her testimony before the House Financial Services Committee that the central bank will continue to scale back its economic stimulus program at a guarded pace.

By downplaying the recent progress made in lowering the U.S. jobless rate, the new chief of the Fed on Tuesday reminded investors that the window for raising the short-term fed funds rate remains "firmly shuttered," said Andrew Wilkinson, chief market analyst at Greenwich, Conn.-based Interactive Brokers, in a note. Wilkinson described Yellen's comments as producing a "dovish undercurrent."

The S&P 500 ended 1.11% higher to 1,819.75. The Dow Jones Industrial Average was up 1.22% to 15,994.77 while the Nasdaq added 1.03% to 4,191.04.

Yellen said in her prepared testimony that a reduction in the Fed's monetary stimulus program is not on a preset course, and added that it would remain contingent on the labor market and inflation.

"Too many Americans remain unemployed, inflation remains below our longer-run objective, and the work of making the financial system more robust has not yet been completed," Yellen explained.

CVS Caremark  climbed 2.7% to $68.77 after beating fourth-quarter earnings per share expectations by a penny at $1.12. The drugstore chain also topped revenue estimates, bolstered by an increase in same-store prescription volumes and recent generic introductions.

Rackspace Hosting  plunged 19.1% to $32.65 after the cloud computing company posted exceptionally weak fourth-quarter results and announced the departure of CEO Lanham Napier.

Sprint was up 2.7% to $7.90 after posting a narrower fourth-quarter loss and revenue that exceeded expectations.

Fossil Group  reported after the bell, beating expectations with revenue nearly 12% higher than a year earlier. In aftermarket trading, shares were up 5.6% to $123.50. 

-- Written by Andrea Tse and Keris Lahiff in New York