U.S. stocks rebounded Wednesday to close mostly higher after the Dow Jones Industrial Average plunged as much as 277 points in morning trading. A recovery in energy and technology stocks helped stage a comeback on Wall Street as investors continued to weigh China’s devalued yuan and whether it will delay the Federal Reserve’s first interest rate hike in nearly a decade.

The Dow (INDEXDJX:.DJI) dipped just 0.33 points, or zero percent, to close at 17,402.51. The Standard & Poor's 500 index (INDEXSP:.INX) added 1.98 points, or 0.10 percent, to end at 2,086.05. And the Nasdaq composite (INDEXNASDAQ:.IXIC) rose 7.60 points, or 0.15 percent, to finish at 5,044.39.

For the year, the Dow has lost 421 points, or 2.4 percent. However, the S&P 500 has added 27 points, or 1.32 percent, and the Nasdaq composite has added 309 points, or 6.5 percent, so far this year.

Just last month, the markets faced multiple bouts of volatility, driven by uncertainty surrounding Greece’s debt crisis, a precipitous drop in China’s equity markets and a rare halt in trading at the New York Stock Exchange because of a technical issue. Yet U.S. stocks have continued to grind higher, even in the face of turmoil and uncertainty throughout the world.

So what’s been driving the market swings this week? The Federal Reserve. Wall Street is trying to anticipate whether the central bank will stay on course and lift rates in September or wait in the midst of China's economic slowdown. 

“If this situation persists in China, December is a really likely timetable for the Fed to announce raising rates,” said Mario Minotti, president of the Minotti Group. Just last week, Minotti said he thought there was a 60 percent chance the Fed would hike in September, but after the last two days, he lowered his expectations and now thinks there’s a 30 percent chance of a September liftoff.

The yield on the benchmark 10-year Treasury note sank 2.11 percent Wednesday in response to China further devaluing the yuan. The decline in yields helped push interest rate-sensitive sectors higher, as utilities rose 1.6 percent in the S&P 500.

The decline in yields is also telling because it signals investors anticipate the Federal Reserve will wait until after September to lift interest rates.

Even so, analysts say it’s important to put into perspective the yuan’s move is this week. The currency has declined 4 percent so far this week, but in the last 20 years it has appreciated 80 percent. “In that light, this isn’t a huge move,” said Mike Baele, managing director at U.S. Bank Wealth Management in Portland, Oregon.

But there is another issue. The yuan’s recent depreciation also could cast a shadow on earnings growth from U.S. multinationals, as a strong dollar isn’t exactly good news for corporate bottom lines.

China is the new Europe, or the weak link in U.S. global earnings, says Joseph Quinlan, chief market strategist for U.S. Trust, as China’s weak growth has tattered the bottom line of many U.S. firms.

But investors should avoid hitting the panic button. “U.S. global earnings are poised to improve over the near-term, courtesy of better figures out of Europe,” Quinlan said in a note this week.

A key tailwind lies with Europe, specifically with its ongoing economic recovery that Quinlan says is poised to provide a solid earnings boost to U.S. global earnings over the medium term.

Six of the 10 S&P 500 sectors closed higher, led by a 2 percent rebound in energy, while utilities and technology rose 1.6 percent and 0.5 percent, respectively.

Technology also led the Dow higher, with chip maker Intel Corporation and iPhone maker Apple Inc. (NASDAQ:AAPL) gaining 1.7 percent and 1.5 percent, respectively.

Meanwhile, the world’s largest and second-largest oil companies -- Exxon Mobil Corporation and Chevron Corporation (NYSE:CVX) -- added more than 1 percent after oil prices rebounded. The gains in oil were helped by a weaker U.S. dollar and a decline in crude stockpiles after crude prices tumbled to a six-year low a day earlier.

West Texas Intermediate (WTI) crude, the benchmark for U.S. oil prices, gained 0.5 percent to $43.30 per barrel for September delivery on the New York Mercantile Exchange. On the London ICE Futures Exchange, Brent crude, the global benchmark for oil prices, added 53 cents to $49.70.