U.S. stocks closed higher Wednesday, helped by a recovery in health care stocks and gains in energy, as investors awaited the beginning of earnings season. ( Tweet This )
Health care was the greatest advancer in the S&P 500 on the day, helping the index come within 5 points of the psychologically key 2,000 level.
The index also found support from gains of about 1.3 percent in materials, industrials and energy.
"Oil prices are what were supporting the surge. We'll need to see better earnings, higher revenues in order to support this," said Chris Gaffney, president of world markets at Everbank.
After rising nearly 1 percent in opening trade, the major averages briefly dipped into negative territory, following declines in oil prices.
"I think what happened here was people said this was a good place to take profits," said Marc Chaikin, CEO of Chaikin Analytics. He doesn't think stocks have bottomed yet and noted that the S&P 500 hit resistance between 1,980 and 2,000.
"There's going to be a sort of a battleground right there," he said. "A lot of people piled into the market (in the last few days) especially in energy and materials, because they thought a W-bottom had occurred."
Oil fluctuated between gains and losses after weekly oil inventories showed an increase of 3.073 million barrels, above expectations of an increase of 2.5 million barrels.
Crude settled down 72 cents, or 1.48 percent, at $47.81 a barrel, giving back some of Tuesday's 4.9 percent surge. Brent held just above $51 a barrel.
"If you look at the positive influence on the market this week and last week, it's been commodities," said Art Hogan, chief market strategist at Wunderlich Securities.
Crude has not closed outside of a $5.20 range between $44 and $49.20 a barrel since Aug. 27.
"I think oil's put in a nice bottom here," said Peter Coleman, head of trading at Convergex. "People are looking at bottom fishing into the energy sector at this point. ... The money coming out of biotech and health care in general is making it back into the energy sector."
He added that the market held up pretty well Tuesday despite a sharp drop in the biotech sector. "There's a bit of a bias to buy at this point," Coleman said ahead of the opening bell.