Stocks Snap 3-Week Losing Streak

Stocks eked out a gain Friday after struggling all day as investors weighed a better-than-expected reading on consumer sentiment against a disappointing retail-sales report.

The Dow Jones Industrial Average rose 38.54, or 0.4 percent, to close at 10,211.07.

That helped the Dow snap a three-week losing streak, with the blue-chip index finishing up 2.8 percent for the week. It also pulled the Dow out of correction mode. The S&P 500and Nasdaq, however, remained in correction territory, down more than 10 percent from their April high.

Techs were the big winners today, with the tech-heavy Nasdaq finishing up more than 1 percent. For the week, though, techs were the biggest decliners. Materials, energy and telecoms were the biggest gainers.

The CBOE volatility index, widely considered the best gauge of fear in the market, was around 28.60 at the closing bell.

Investors toggled between the risk trade and playing it safe this week but Marc Pado, U.S. strategist at Cantor Fitzgerald & Co. said investors should add to risk positions over the next few weeks ahead of the earnings season. "Small, domestic technology stocks will be strong and I think that retail has a good chance for a solid bounce," said.

One big boost for the market: A gauge of consumer sentiment jumped to 75.5in a mid-June reading, the highest since January 2008, according to the latest University of Michigan and Reuters survey. That's up from 73.6 at the end of May and better than the 74.5 expected.

Earlier, a government report showed retail sales fell 1.2 percent in May despite projections that they would increase 0.2 percent. It was the largest decline in eight months as consumers slashed spending on everything from cars to clothing. Building materials saw one of the biggest declines, falling 9.3 percent.

However, the decline was "very narrowly concentrated" and the report was "much more positive" than the headline figures suggest, Nomura economists wrote in a research note to clients.

"Overall recent retail sales reports show a cooling in consumer spending growth from Q1 but not outright retrenchment."

And business inventories rose 0.4 percent in April; economists had expected a 0.5-percent gain.

Oil settled at $73.78 a barrel, up over 3 percent for the week.

BP gained 3.6 percent, adding to their 12-percent gain from the prior session. The company denied an earlier report from the UK times saying the firm is planning to defer their dividend payouts to investors. There's a rising backlash from the UKover the US's tough talk with the company which has slashed the company's market cap in half. An estimated 10 percent of pensions in the UK include the oil giant's stock.

The dollar rose against the euroand gold settled at $1,230.20 an ounce as buyers took advantage of recent declines.

Banks finished mixed.

JPMorgan Chase shed half a percent after the firm's head of investment banking said the company's second-quarter earnings performance could be affected by a reduction in client risk appetites.

Separately, JPMorgan and Morgan Stanley are expected to lead the undewriting rolefor the GM IPO. Morgan Stanley shares gained 1.6 percent.

Earlier this week, Rochdale analyst Dick Bove cut his price target and earnings forecaston JPMorgan, saying the brokerage is "facing challenges in its business model almost everywhere." Bove also cut his price targetson Bank of America and Goldman Sachs . Those stocks finished higher.

MasterCard shares fell after Susquehanna cut the credit card issuer's price target to $276 from $287.

The boost for techs came from National Semiconductor , which beat expectations with its earnings and forecast. S&P raised its credit rating on the company.

Dell rose after the computer maker said it has set aside $100 million for a potential settlement with the SEC, which has been probing the company's accounting practices and relationship with chipmaker Intel .

Elsewhere in tech land, Research In Motion and Motorola have settled a patent dispute over mobile technology. Both stocks finished higher.

Dow component Caterpillar and Navistar are working out a $586 million truck and engine manufacturing deal with China's Anhui Jianghuai Automobile, a source told Reuters.

Pharmaceuticals rose after Barclays Capital raised its rating on the sector to "positive" from "neutral," citing upside to the revenue from new products offsetting any possible impact from patent expiration.

A couple of individual stocks were upgraded in the pharma sector, including Bristol-Myers Squibb and Pfizer.

Meanwhile, a U.S. congressional committee investigating the recent recall of Johnson & Johnson's children's medicine said it is concerned about the manufacturer's cooperation, raising the prospect that new measures—such as issuing of subpoenas—could be invoked.

On the M&A front, Wendy's/Arby's shares jumped 7 percent after the fast-food chain said it was approached by an unnamed group interested in possibly acquiring the company.

In today's Fed speak, Philadelphia Fed President Charles Plosser said the U.S. central bank should start selling mortgage-related assets "sooner rather than later" to avoid sowing the seeds of future inflation.

And Minneapolis Fed President Narayana Kocherlakota said, "The economy is on the way back to recovery" and "I am optimistic, especially regarding growth prospects and the impact of inflation."

Volume was light, with about 1 billion shares changing hands on the New York Stock Exchange. Advancers outpaced decliners, roughly 2 to 1.

Coming Up Next Week:

MONDAY: Fed's Bullard speaks; SEC's Schapiro speaks; BoJ monetary policy meeting; Box office futures decision expected
TUESDAY: Fed's Bullard speaks; Empire State survey; import & export prices; credit card default rates expected; E3 video game conf.; Earnings from Best Buy
WEDNESDAY: Weekly mortgage apps; PPI; housing starts; industrial production; weekly oil inventories; Fed's Plosser speaks; Disney insider trader hearing; China trade hearing; Earnings from FedEx
THURSDAY: CPI; weekly jobless claims; current accounts; leading indicators; Philadelphia Fed survey; BP CEO testifies
FRIDAY: Quadruple witching; S&P indexes rebalanced

More From CNBC.com: