Stocks moved cautiously higher on Wednesday as investors waited for direction from a number of market-churning events on Thursday and a major selloff in crude kneecapped indexes. 

The S&P 500 was up 0.11%, the Dow Jones Industrial Average gained 0.06%, and the Nasdaq rose 0.2%. 

Losses in crude oil prices picked up speed on Wednesday after a surprise increase in domestic crude stockpiles. Inventories rose by 3.3 million barrels in the past week, the Energy Information Administration said, surprising analysts looking for a decrease of 3.5 million barrels. Gasoline and distillates stockpiles both increased.

Adding to risks, on Tuesday the EIA reduced its price forecast for oil next year. The energy watchdog now anticipates West Texas Intermediate to average $53.61 a barrel over 2018, 2.7% than its former target, though 2017 price forecasts were increased by 0.2% to $50.78. The EIA also nudged its 2018 U.S. production targets higher.

Commodities have been under pressure this week after Saudi Arabia led a group of allies to cut diplomatic ties with Qatar for its alleged association with terrorism. The effect on a recently extended production cut agreement among Organization of Petroleum Exporting Countries is not yet known.

West Texas Intermediate crude was down 4.3% to $46.11 a barrel on Wednesday.

You can't expect a real panic to liquidation to begin until oil reaches $43 a barrel, Cramer argued on Real Money. Get his insights with a free trial subscription to Real Money.

The energy sector was the worst performer on markets Wednesday. Major oil companies Exxon Mobil (XOM) , Chevron (CVX) , BP (BP) , ConocoPhillips (COP)  and Occidental Petroleum (OXY) sported major losses, while the Energy Select Sector SPDR ETF (XLE) declined 1.4%. 

If you liked this article you might like

Closing Bell: Netflix Boosts Tech Names; Trump Gives Broad Tax Brushstrokes

Gas Prices and Uber's New CEO - 5 Things You Must Know Before the Market Opens

TheStreet's Daily Market Preview: Fox News, Hurricane Harvey and Uber's Mounting Challenges

Investors Brace for Market Open After 'Catastrophic' Texas Flooding

Here Comes Another Jobs Report