By Anora Mahmudova, MarketWatch

NEW YORK (MarketWatch) -- U.S. stocks extended their four-day winning streak, ending Tuesday with solid gains as Federal Reserve Chairwoman Janet Yellen pledged to keep interest rates low and to continue to taper the pace of bond purchases if the economy keeps improving.

The S&P 500 index (SPX) closed up 19.91 points, or 1.1% at 1,819.75, its best gain over four straight days since Dec. 23, 2011. The Dow Jones Industrial Average (DJI) closed up 192.98 points, or 1.2%, at 15,994.77 after briefly topping 16,000. The 3.6% gain over the past four days was the best four-day streak since June 8, 2012.

The Nasdaq Composite (RIXF) ended the day 42.87 points, or 1%, higher at 4,191.04. The tech-heavy index turned positive for 2014 and is now up 0.3% so far this year. Read the recap of our stock market live blog.

Yellen said the Fed will continue to follow its low-interest-rate policy course during a hearing before the House Financial Services Committee. "Let me emphasize that I expect a great deal of continuity in the Federal Open Market Committee's approach to monetary policy," she said.

On Thursday, she will testify before the Senate Banking Committee. Follow live blog of Janet Yellen's testimony before Congress.

"The fact that Yellen will continue with tapering gives investors confidence that the weather issues are transitory and problems in the emerging markets are not big enough to drag the U.S. toward a recession," said Phil Orlando, chief equity market strategist at Federated Investors.

"After the selloff in the markets which began in mid-January and until early February, Treasuries and Vix were overbought and equities were oversold. Once the emerging markets fears subsided and collective economic data were generally strong, money began to flow into the stocks and markets bounced off," Orlando said.

"We believe the near 6% drop in the S&P 500 and 8% drop in the Russell 2000 were healthy and are now over. However, we may see more such pullbacks during the year," he added.

There were several other economic reports released on Tuesday. A gauge of optimism among small businesses ticked up in January, led by sales expectations and hiring plans. U.S. wholesale inventories and wholesale sales in December also ticked up. Job openings at U.S. workplaces ticked down to 3.99 million in December from 4.03 million in November.

In corporate news, Sprint shares (S) rose 2.7% after the company reported a narrower loss for the fourth quarter.

CVS Caremark Corp. (CVS) shares rose 2.7% after the drugstore chain posted a rise in profit and adjusted earnings beat estimates. Chief Executive Larry Merlo calling the results "somewhat atypical" as they were boosted by Medicare and the timing of generics.

Rackspace Hosting Inc. (RAX) slid 19% after posting a 30% drop in profit late Monday, as higher costs more than offset growth in revenue. It also said Chief Executive Lanham Napier would retire.

Shares in DSW Inc. (DSW) rallied 3.8% on Tuesday after the company narrowed its full-year adjusted earnings guidance as fourth-quarter same-store sales came in flat. It also announced Chief Financial Officer Douglas Probst will retire May 1.

WPX Energy (WPX) late Monday said its fourth-quarter and full-year earnings will be impacted by up to $1.4 billion in pretax charge stemming from a drop in forward market natural gas prices. WPX shares slumped 10%, the biggest loser in the S&P 500.

ConAgra Foods Inc. (CAG) shares fell 6.3% after the food company said Tuesday it cut its view for fiscal year 2014.

In other markets, European stocks rose for a fifth straight day, while shares in Hong Kong rallied and Tokyo was shut for a holiday. Gold pushed a win streak toward a fifth session, while oil rose and the dollar fell against the British pound and Australian dollar.

More stories from MarketWatch:

Scary 1929 market chart gains traction

What's unnerving about the S&P 500's pullback this year

What's next, S&P 1600 or 1900?

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

CVS Health (NYSE:CVS)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more CVS Health Charts.
CVS Health (NYSE:CVS)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more CVS Health Charts.