By Anora Mahmudova, MarketWatch

NEW YORK (MarketWatch) -- The U.S. stock market edged higher on Tuesday as Federal Reserve Chairwoman Janet Yellen struck a dovish tone in her prepared remarks to lawmakers.

Yellen said markets should expect the central bank to continue to follow the low-interest-rate path laid out by her predecessor, Ben Bernanke.

The S&P 500 (SPX) added 5.3 points, or 0.3%, to 1,805.16, rising for the fourth straight session. The Dow Jones Industrial Average (DJI) was up 57 points, or 0.4%, at 15,858.93.

The Nasdaq Composite (RIXF) rose 14 points, or 0.3% to 4,161.07 and is close to erasing losses year-to-date. Follow our stock market live blog.

Stocks have risen for the past three sessions after testing key technical levels. Still, some analysts are skeptical about calling an end to a correction.

Yellen is scheduled to formally deliver her remarks and answer questions from the members of the House Financial Services Committee at 10 a.m. Eastern. In her prepared remarks she said: "Let me emphasize that I expect a great deal of continuity in the Federal Open Market Committee's approach to monetary policy."

On Thursday, she will testify before the Senate Banking Committee. Read: Markets alert for any new policy signal from Yellen

Separately, a gauge of optimism among small businesses ticked up in January, led by sales expectations and hiring plans, according to data released Tuesday. Later, at 10 a.m. Eastern Time, data on wholesale inventories and job openings for December will be published.

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

CVS Caremark Corp. (CVS) shares rose 3% after the drugstore chain posted a rise in profit and forecast 2014 earnings in a range of $4.36 to $4.50 per share.

Rackspace Hosting Inc. (RAX) slid 13% 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.2% 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.

In other markets, European stocks climbed, 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 pulled back.

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

Rackspace Hosting, (delisted) (NYSE:RAX)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Rackspace Hosting, (delisted) Charts.
Rackspace Hosting, (delisted) (NYSE:RAX)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Rackspace Hosting, (delisted) Charts.