Stocks rose sharply on Wednesday, notching a four-day winning streak as banks and tech carried major indexes higher. They rose despite a jump in bond yields.

The Dow Jones industrial average closed 253.04 points higher at 24,893.49 after falling as much as 150 points. Goldman Sachs contributed the most to the gains, rising 2.8 percent. The 30-stock index also erased all of its 2018 losses and posted its longest winning streak since Jan. 5.

The gained 1.3 percent to 2,698.63, with financials and tech each rising more than 1.5 percent. Bank of America, J.P. Morgan Chase, Citigroup and Morgan Stanley all traded higher. The financials sector had its best day since Nov. 28. The index also turned positive for 2018.

The Nasdaq composite advanced 1.9 percent to close at 7,143.62, as shares of Facebook, Amazon, Netflix and Alphabet rose.

"It almost looks like the market is realizing the economy is still doing well," said Ryan Detrick, senior market strategist at LPL Financial. He noted however, the market is "still in the process of carving off a bottom. ... There's going to be more volatility ahead."