Stocks edged up on Wednesday but were off their earlier highs as bank shares turned negative.

Gains came from energy stocks after a steep selloff in commodity shares in the previous session.

Shares of JPMorgan Chase & Co were up 0.3 percent at $46.75 after rising more than 1 percent. The bank reported better-than-expected first-quarter results before the bell, but in an analyst call, the company's chief executive said there would not be another dividend hike soon.

The Financial Select Sector SPDR Fund turned negative. Bank of America shares fell 0.1 percent to $13.45 and Citigroup slipped 0.7 percent to $4.52.

There is really a disparity between large-cap banks and regional, community banks. The large caps will be mostly influenced by the stock move in JPMorgan, said Jay Suskind, senior vice president at Duncan-Willams in Jersey City, New Jersey.

The Dow Jones industrial average <.DJI> was up 32.54 points, or 0.27 percent, at 12,296.12. The Standard & Poor's 500 Index <.SPX> was up 2.62 points, or 0.20 percent, at 1,316.78. The Nasdaq Composite Index <.IXIC> was up 17.09 points, or 0.62 percent, at 2,761.88.

(Reporting by Angela Moon, Editing by Kenneth Barry)