By Sara Sjolin and Anora Mahmudova, MarketWatch

Health-care shares lead gains, up 1.4%

U.S. stocks rallied then trimmed gains on Wednesday as Federal Reserve Chairwoman Janet Yellen testified before a congressional committee.

In prepared remarks, the Fed chief said financial conditions "have become less supportive to growth" and acknowledged "downside risks" (http://www.marketwatch.com/story/yellen-says-financial-conditions-less-supportive-to-growth-2016-02-10) largely stemming from uncertainty about the health of the Chinese economy.

Answering a question about the central bank's December rate increase, Yellen said she did not think it would be necessary to cut rates, but that if it turned out to be necessary, the Fed wouldn't hesitate to ease.

Watch: Live blog and video of Janet Yellen's appearance before House Committee (http://blogs.marketwatch.com/capitolreport/2016/02/10/live-blog-and-video-of-janet-yellens-appearance-before-house-committee/)

Still, Yellen didn't close to door on the possibility of rate increases in 2016, underscoring the Fed's plan for gradual rate increases amid persistent turmoil in the global economy and signs of shakiness in the U.S. labor market.

The S&P 500 added 13 points, or 0.7%, to 1,865. Health-care shares led gains, up 1.4%, followed by gains in technology stocks, up 1.2%.

The Dow Jones Industrial Average advanced 56 points, or 0.4%, to 16,073. Meanwhile, the Nasdaq Composite climbed 55 points, or 1.3%, to 4,323.

Market participants warned that the Yellen must walk a fine line in her testimony. Too dovish a posture and she could raise alarms about the economy, while too hawkish a posture threatens to roil stocks, expecting punishing rate increases amid a world-wide economic slowdown.

"Janet Yellen had to be dovish enough so as not to spook the market but hawkish enough to signal that the economy is still growing and she achieved that," said Kelly Bogdanov, vice president and portfolio analyst at RBC Wealth Management.

See: How Yellen could lift global stocks and commodities (http://www.marketwatch.com/story/how-yellen-could-lift-global-stocks-and-commodities-2016-02-10).

"At some point Yellen will need to bridge the gap between what the market expects--which is no rate hikes this year--and the Fed's plan to normalize rates. But she does not have to do that in March, there is still time and lots of data points to change those expectations," Bogdanov said.

The gains followed a rally in Europe (http://www.marketwatch.com/story/european-stocks-snap-7-day-losing-streak-as-oil-rebounds-2016-02-10), where banks steadied somewhat after a recent selloff.

Watch video and see live blog of Yellen testimony (http://blogs.marketwatch.com/capitolreport/2016/02/10/live-blog-and-video-of-janet-yellens-appearance-before-house-committee/).

The stock market has suffered its worst start to the year so far, with the S&P 500 down 8.4% year to date. Some investors believe that has been due to overreaction by investors.

"Going forward there is a lot of positive in earnings growth, so buying this dip would be good for investors at this point," said Kate Warne, investment strategist at Edward Jones.

U.S. stocks ended a choppy session slightly lower on Tuesday (http://www.marketwatch.com/story/wall-street-scrabbles-for-direction-with-one-eye-on-yellen-2016-02-09) as traders turned cautious of making any big moves ahead of the testimony. On Thursday, Yellen will appear before the Senate Banking Committee.

Also on the economic calendar on Wednesday, the federal budget for January is due out at 2 p.m. Eastern Time.

Movers and shakers: Shares of SolarCity Corp. (SCTY) tumbled 26% after the solar power company late Tuesday said it'll continue to fall short of its installation goals (http://www.marketwatch.com/story/solarcity-shares-drop-on-soft-forecast-2016-02-09-18485718).

Walt Disney Co. (DIS) dropped 3.7% on concerns about its cable-sports network (http://www.marketwatch.com/story/disney-espn-concern-undercuts-star-wars-strength-2016-02-09).

U.S.-listed shares of Deutsche Bank AG (DBK.XE) rallied 7.2% on news the German bank is considering buying back billions of euros of its own bonds (http://www.marketwatch.com/story/deutsche-bank-shares-rally-on-debt-buyback-report-2016-02-10).

Time Warner Inc. (TWX) inched fell 3.8% even as the media company reported better-than-expected fourth-quarter profit (http://www.marketwatch.com/story/time-warners-stock-climbs-after-profit-beat-expectations-dividend-raised-2016-02-10).

After the close, Twitter Inc. (TWTR) is expected to report, with analysts watching for user growth (http://www.marketwatch.com/story/twitters-bullish-divergence-gives-investors-a-glimmer-of-hope-2016-02-09) and rumored product changes.

Also reporting after hours are Cisco Systems Inc. (CSCO), Expedia Inc. (EXPE), Tesla Motors Inc. (TSLA) and Whole Foods Market Inc. (WFM).

Read: Tesla earnings: Model 3 spending, Model X sales in focus (http://www.marketwatch.com/story/tesla-earnings-model-3-spending-model-x-sales-in-focus-2016-02-05)

Other markets: Asian stock markets closed mostly lower. Japan's Nikkei 225 index closing at the lowest level since 2014 (http://www.marketwatch.com/story/japan-stocks-hit-lowest-level-since-2014-2016-02-09), while China's markets remained closed for a holiday.

Oil futures partly rebounded after Tuesday's sharp selloff, with both West Texas Intermediate crude oil and Brent were climbing (http://www.marketwatch.com/story/oil-hovers-above-28-a-barrel-as-market-braces-for-more-supply-data-2016-02-10).

Metals prices dropped across the board, while the ICE dollar index inched higher.

 

(END) Dow Jones Newswires

February 10, 2016 11:30 ET (16:30 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.