Dow, S&P snap 5-day losing streak as oil pops 12%

U.S. equities closed sharply higher on Friday as European and American bank stocks — as well as oil prices — bounced sharply, while investors digested U.S. economic data.

"I think people are finally seeing lots of things worth buying," said Adrian Day, chairman and CEO of Adrian Day Asset Management.

The Dow Jones industrial average gained more than 300 points, as Goldman Sachs and JPMorgan Chase contributed the most gains, snapping a five-day losing streak but still lost about 1.4 percent for the week.

Dow this weekSource: FactSet

"I definitely urge caution, but the conditions are there for a short-term bounce," said Adam Sarhan, CEO of Sarhan Capital.

Read MoreDimon buys more than $25M in JPM stock

JPMorgan's stock gained 8.3 percent on Friday after CEO Jamie Dimon bought over $25 million worth of the company's stock.

"If he pulls the trigger, that gives people confidence," Day said.

The S&P 500 index gained 1.9 percent, as financials rose 4 percent. The index also snapped a five-day losing streak.

The Nasdaq composite rose 1.4 percent.

Read MoreStreet Explained: Fallout from negative rates

"We're going to need a lot more than this to gain some ground," said Randy Warren, chief investment officer at Warren Financial Service. "I wouldn't get my hopes up but oil has to hit bottom at some point."

In Europe, shares of Deutsche Bank rose 11.8 percent after the bank said it was buying back over $5 billion in bonds, while Commerzbank's stock gained 18.02 percent amid a strong earnings report.

The pan-European STOXX 600 index rose 2.91 percent.

Markets in mainland China have been closed this week due to the Lunar New Year Holiday and are scheduled to reopen Monday. However, U.S. markets will be closed on Monday due to the President's Day holiday.

Read More'Arrogant' Fed—stop swimming upstream

U.S. oil prices also boosted stock prices in the U.S., as WTI settled 12.32 percent higher, or $3.23, at $29.44 a barrel.

"The proposed deal for a cease-fire in Syria might help bring the Saudis to the table for an OPEC deal," said Peter Cardillo, chief market economist at First Standard Financial. "I believe one of the reasons oil prices are so low is geopolitical."

WTI settled 4.5 percent lower on Thursday, but began paring most of those losses after a report surfaced that OPEC was ready to cooperate with a production cut.

"We hit a new low and tons of short covering came into the market. That UAE headline was well timed," said John Kilduff, founding partner of Again Capital. "They arguably held the bottom. from a technical perspective on a short-term basis."

U.S. equities fell sharply Thursday amid a global sell-off, with the Dow falling more than 250 points. The Dow and S&P are also still down more than 8 percent year to date, while the Nasdaq is down over 13 percent.

"This is one of the more orderly sell-offs I've seen in my life," JJ Kinahan, chief strategist at TD Ameritrade, told CNBC on Thursday. "We haven't had any panic days."

Investors also digested U.S. retail sales, which rose 0.2 percent in January, above the 0.1 percent expected gain. Import prices in the U.S. fell 1.1 percent, less than expected.

"Bottom line, notwithstanding a pretty ugly month in the markets, the prospect of better wage growth seemed to help lift retail sales after a disappointing December. I'm not going to say lower gasoline prices was the reason for better than expected sales because if it hasn't been a lift so far because of a variety of cost of living offsets, why should it all of sudden been one in January," Peter Boockvar, chief market analyst at The Lindsey Group, said in a note.

"If you take a look at the jobs data and retail sales, there are few signs that the U.S. economy is heading into a recession," said Art Hogan, chief market strategist at Wunderlich Securities.

Other data points due Friday included consumer sentiment, which came in below expectations, and business inventories, which rose 0.1 percent in December.

"Nobody's paying attention, but consumer confidence has been rising month in, month out," said Jack Ablin, chief investment officer at BMO Private Bank. "I wouldn't be surprised to see further gains in retail."

Read MoreGartman: I'm not so bullish on bullion right now

U.S. Treasury yields rose on Friday, with the 10-year yield trading at 1.73 percent, after briefly falling below the 1.55 percent mark on Thursday.

"You don't see that kind of move normally," Hogan said. "That's indicative of some of that flight-to-safety money coming back into risk assets."

Other traditional safe havens fell on Friday, including gold, which gained more than $50 on Thursday. Gold futures for April delivery settled at $1,239.40 an ounce, down $8.40.

The dollar gained 0.52 percent against the euro and 0.88 percent against the yen.

Investors also digested comments from New York Fed President William Dudley, in which he said the key components of the U.S.economy remain healthy. He also said that any talk about negative interest rates coming to the U.S. is "extraordinarily premature."

S&P 500

The Dow Jones industrial average closed 313.66 points higher, or 2 percent, at 15,973.84, with JPMorgan Chase leading all stocks higher.

The S&P 500 ended 35.70 points higher, or 1.95 percent, at 1,864.78, as financials led nine sectors higher and utilities lagged.

The Nasdaq rose 70.67 points, or 1.66 percent, to close at 4,337.51.

The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded near 26.

Advancers led decliners 4 to 1 on the New York Stock Exchange, with an exchange volume of 1.159 billion and a composite volume of 4.657 billion at the close.

High-frequency trading accounted for 49 percent of February's daily trading volume of about 9.66 billion shares, according to TABB Group. During the peak levels of high-frequency trading in 2009, about 61 percent of 9.8 billion of average daily shares traded were executed by high-frequency traders.