US Markets

Stocks recover from sharp losses as oil rise boosts energy

Cashin: Selloff 90% China
VIDEO4:3904:39
Cashin: Selloff 90% China
McCulley: Fed will get off zero
VIDEO1:2501:25
McCulley: Fed will get off zero
Pisani's market open: Fossil surprises
VIDEO3:2803:28
Pisani's market open: Fossil surprises

U.S. stocks closed mostly higher on Wednesday, recovering from sharp intraday declines as gains in energy offset earlier pressures from growth concerns.(Tweet This)

"We did hold the lower end of that support level range (on the S&P 500)," said Peter Cardillo, chief market economist at Rockwell Global Capital. "Probably more important is we had oil prices stabilize."

The Nasdaq Composite turned positive, ending mildly higher after earlier falling 1.5 percent.

The S&P 500 turned higher as energy jumped nearly 2 percent to lead sector gains. The index attempted to hold above support levels after breaching them to dip into negative territory for the year. More than half of the stocks in the S&P 500 are trading in correction territory.

The Dow Jones industrial average attempted mild gains after falling as much as 277 points, which followed Tuesday's 212-point loss.

"It's a very interesting reversal. Volume was extremely heavy in the first hour, hour-and-a-half—almost margin call selling in the energy sector. Once that selling ... abated close to 11 o'clock, we also saw some short covering," said Peter Coleman, head trader at Convergex. "The rally was interesting too, it was a slow growth rally."

"The sellers have sold what they had to sell," he said. Barring anything out of China overnight, "I think we've probably put in a short-term low."

Major averages one-day performance


The major averages trimmed losses in midday trade as oil recovered to boost the energy sector and Apple turned higher to gain more than 1 percent.

Earlier, stocks plunged for a second day in a row as the yuan declined against the dollar for a second day, increasing negative sentiment on China's economic growth.

Read MoreStrategist: Financial market rout like 2008's is ahead

"It's still a reaction to the Chinese yuan and the fear that many individual stocks are in oversold territory. The pressure will be on the overall stocks to hold 2,060/2,065 on the SPX cash," JJ Kinahan, chief strategist at TD Ameritrade, said of morning trade.

The People's Bank of China set the yuan fixing at 6.3306 against the U.S. dollar on Wednesday, 1.6 percent weaker than the previous day's level.

The move signaled Beijing's new commitment to set the daily fixings according to the previous day's closing spot prices and market-moves of other major currencies.

The yuan extended losses, dipping to 6.42 per dollar, its weakest level in four years, fueling expectations of more sustained weakness and a feared "currency war"—where countries artificially weaken their currencies to gain a competitive advantage.

Read More 5 ways China's devaluation could shake up the markets

The currency jumped 1 percent towards the end of the session as China intervened in the foreign exchange markets in final minutes of trading to prevent an excessive fall in the value of the yuan, The Wall Street Journal reported Wednesday.

Alibaba closed down 5.12 percent after initially plunging 7.9 percent to a post-IPO low. The China-based e-commerce giant missed on revenue and posted the slowest growth in more than three years. However, adjusted quarterly profit was 59 cents per share, 1 cent above estimates.

"I'm surprised BABA is down so much," said Brendan Ahern, chief investment officer at KraneShares, which provides China-focused ETFs. "Core business was solid—(gross merchandise value) and users grew great. Compensation expense is large. Not that bad of a quarter, though all the headline news around China isn't going to help."

Read More Alibaba confident in growth despite China concerns: CEO

Macy's plunged more than 5 percent after reporting earnings that missed on both the top and bottom line. The retailer also lowered its forecast.

U.S. stocks closed lower by about 1 percent on Tuesday after an unexpected move overnight by the People's Bank of China to depreciate the yuan by nearly 2 percent. The Dow Jones industrial average closed about 210 points lower, wiping out most of Monday's gains. The index's 50-day moving average fell below its 200-day moving average, a bearish condition many analysts term a "death cross ."

Major U.S. Indexes


Federal Reserve policies can benefit U.S. labor markets but cannot alone solve the so-called skills mismatch between workers and employers, New York Fed President William Dudley said in prepared remarks.

U.S. job openings totaled 5.2 million in June, versus 5.3 million expected.

Marie Schofield, chief economist and senior portfolio manager at Columbia Threadneedle Investments, said the three-month averages on JOLTS and nonfarm payrolls is "not showing anything other than status quo in hiring."

She said China's yuan devaluation put more of a question market around a September rate hike than the data.

Treasury yields turned higher, with the 10-year yield at 2.15 percent and the at 0.67 percent.

The Treasury Department auctioned $24 billion in 10-year notes at a high yield of 2.115 percent, the lowest since April.

The U.S. dollar fell more than 1 percent against major world currencies as the euro approached $1.12.

Crude oil recovered from Tuesday's six-year low, settling up 22 cents, or 0.5 percent, at $43.30 a barrel. Brent traded near $49.60 a barrel.

Gold ended up $15.90 at $1,123.60 an ounce.

Read MoreEarly movers: BABA, FIS, DHI, GE, CREE, FOGO, WFC, GSK, MCD & more

The Dow Jones Industrial Average closed down 0.33 points, or 0.00 percent, at 17,402.51, with JPMorgan Chase leading decliners and Exxon Mobil the greatest advancer.

The closed up 1.98 points, or 0.10 percent, at 2,086.05, with energy leading six sectors higher and financials the greatest laggard.

The Nasdaq closed up 7.60 points, or 0.15 percent, at 5,044.39.

The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded below 15.

Decliners were a hair ahead of advancers on the New York Stock Exchange, with an exchange volume of 877 million and a composite volume of 4.1 billion in the close.

On tap this week:

Wednesday

Earnings: Cisco, Macy's, News Corp., Alibaba, NetEase, Markit, Wayfair

Thursday

Earnings: Nestle, Kohl's, Nordstrom, Applied Materials, Flowers Foods, El Pollo Loco, King Digital, Party City

8:30 a.m.: Initial claims, retail sales, import prices

10 a.m.: Business inventories

1 p.m.: $16 billion 30-year auction

Friday

8:30 a.m.: PPI

9:15 a.m.: Industrial production

10 a.m.: Consumer sentiment