All 10 major S&P sectors ended higher, led by a 3.78-percent rise in the energy sector. Crude prices settled up 3.7 percent on hopes that OPEC and non-OPEC producers would tackle an unrelenting supply glut.

With oil at 12-year lows and threatening to put higher-cost producers out of business, investors have been reeling from a turbulent start to the year that has left the S&P down 7 percent from the end of 2015.

“This is a schizophrenic market. Big up days, big down days. No real direction,” said Tim Ghriskey, chief investment officer of Solaris Group in Bedford Hills, New York. “We need some stability in oil prices for the markets to calm down from here and become less volatile.”

After the bell, Apple Inc reported lower-than-expected iPhone sales for the December quarter as the company began to feel the effects of economic softness in the critical Chinese market. Its stock was flat.

While the U.S. Federal Reserve is not expected to move on interest rates at its two-day meeting, which began on Tuesday, investors will parse the Fed’s commentary to gauge how recent global turmoil affects the likelihood of future rate hikes.