The S&P 500 and Nasdaq posted gains in trading Wednesday as oil prices rebounded and financial shares slumped. 

The Nasdaq closed at a fresh record, up 0.15% to 5,682.45, beating its previous close of 5,674. 

The Dow Jones Industrial Average fell 0.17%, remaining in negative territory, while the S&P 500 rose 0.07%. Equities have moved between positive and negative territory for most of the trading session.

Oil prices in the U.S. rebounded Wednesday after trading lower earlier in the session. West Texas Intermediate crude oil closed up 0.3% to $52.34 a barrel, after declining 1.6% in the previous session following weekly data that showed a sustained build-up in U.S. oil inventory.

On Wednesday, the Energy Information Administration reported that crude inventories for the week ended Feb. 4, increased by 13.8 million barrels, much more than than expected. A week earlier, crude inventories rose by 6.5 million barrels.

Utilities and real estate were the sectors rising the most on Wednesday.

Financial stocks such as JPMorgan Chase (JPM - Get Report) , Citigroup (C - Get Report) and Goldman Sachs (GS - Get Report)  each fell about 1%. The Financial Select Sector SPDR ETF (XLF - Get Report) declined 0.7%. 

Walt Disney (DIS - Get Report) shares rose 0.7% after the media giant said adjusted earnings in its fiscal first quarter fell 10% year over year to $1.55 a share but still topped analysts' estimates of $1.49. Revenue declined 3% in the quarter ended Dec. 31, to $14.78 billion and fell short of Wall Street's projected $15.27 billion.

CEO Bob Iger, when asked on the company's quarterly conference call Tuesday about a recent report in The Wall Street Journal that he might extend his contract beyond a previously planned retirement date of June 2018, read a carefully prepared statement.

"I'm going to do what's in the best interest of this company which is something that the board is clearly going to help determine," said Iger, who turns 66 on Friday. "While I'm confident that my successor will be chosen on a timely basis and chosen well, if it's in the best interest of the company to extend my term, I'm open to that."

Time Warner (TWX) , which is trying to win government approval for its sale to AT&T (T - Get Report) , posted fourth-quarter earnings that beat analysts' expectations driven by results at CNN and the Warner Bros. film studio. The stock rose 0.4%.

Gilead Sciences (GILD - Get Report) was tumbling 9.5% after the biotech company said total product sales would decline sharply in 2017, hurt by falling patient demand and lower net prices for the company's hepatitis C drugs.

Priceline Group (PCLN) shares rose 0.3% Wednesday after the company said it would purchase Momondo Group, which operates Cheapflights, in a $550 million all-cash deal.

Allergan (AGN - Get Report) posted fourth-quarter adjusted earnings of $3.90 a share, topping Wall Street estimates of $3.75. The stock rose 4.8%.

Allergan is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer or the AAP team buys or sells AGN? Learn more now.

Humana (HUM - Get Report) reported adjusted earnings of $2.09 a share, beating Wall Street estimates of $2.05. Fourth-quarter revenue of $12.9 billion missed expectations. Shares rose 1.8% after the company reported.

Intuit (INTU - Get Report) shares dropped 0.7% after the company warned that fiscal second-quarter earnings would be lower than expected "due to the tax season forming more slowly than usual." The company expects to reported adjusted earnings of up to 5 cents a share, well below estimates of 36 cents.

GrubHub (GRUB - Get Report) shares dropped 2.5% after the company reported earnings of 16 cents a share on revenue of $137.5 million, missing estimates on both the top- and bottom lines.

Panera Bread (PNRA) shares rose 8.3% after the company reported that its revenue rose 5% to $727.1 million, matching estimates, while its earnings of $2.05 a share jumped 6%, beating expectations.

Panera Bread is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells PNRA? Learn more now.

Shares of Microchip Technology (MCHP - Get Report) rose 5.9% after the the company reported earnings of $1.05 a share, beating estimates of 90 cents. Revenue of $881.2 million also surpassed Wall Street's expectations.

Nordstrom (JWN - Get Report) rose 3.2% after slumping earlier Wednesday when Donald Trump tweeted, "My daughter Ivanka has been treated so unfairly by @Nordstrom." The retailer announced last week that it was dropping Ivanka Trump's accessory and clothing lines because of poor performance.

Cognizant Technology (CTSH - Get Report)  rose 4.9% after the information technology company announced it reached a cooperative agreement with activist investor Elliott Management and will appoint three new independent members to its board.  

Earnings are expected later Wednesday from Whole Foods Market (WFM) .