By Anora Mahmudova, MarketWatch

NEW YORK (MarketWatch) -- The U.S. stock market closed higher Friday after an abrupt late-day reversal. Analysts attributed such a move to 'buying the dip' strategy that has been the theme in the past few months.

Stocks traded in negative territory for the most of the session, after mixed economic reports in the morning.

The S&P 500 (SPX) added 7.01 points, or 0.4%, to 1,877.86 and finished the week with a slight loss. It touched record levels during the week.

The Dow Jones Industrial Average (DJI) rose 44.50 points, or 0.3%, to 16,491.31, limiting the weekly loss to 0.6%. It also notched a new record during the week.

The Nasdaq Composite's (RIXF) gain on Friday helped the index to register a weekly gain. The index ended the day up 21.30 points, or 0.5%, at 4,090.59 and gained 0.5% over the week.

Follow MarketWatch's live blog of today's stock-market action.

"It looks like several selloff attempts and shallow retreats brought in buyers in the afternoon," said Gene Peroni, senior vice president of equity research at Advisors Asset Management.

"Markets firmed as short-sellers went neutral going into the weekend, as there is more fear of being short than being long right now," he added.

Kate Warne, investment strategist at Edward Jones echoes this view.

"This has been a consistent pattern: every time stocks decline, buyers arrived and bought the dip as the long-term outlook remains positive," Warne said.

Time to sell this market? Acampora, Tepper think so

Construction on new U.S. homes surged in April to the fastest pace in five months, with the volatile apartment category leading that jump, according to government data released Friday. Results topped economists' forecasts and signaled that home construction is continuing to rebound from a tough winter.

The preliminary May reading of the University of Michigan and Thomson Reuters's gauge of consumer sentiment fell unexpectedly to 81.8 from 84.1 in April. Economists expected to see a reading of 85.

10-year Treasury notes (10_YEAR), which rallied on Thursday amid a flight to safety, fell slightly after the strong housing data, but yields were still at 2.51%.

Retail stocks in focus

Reaction to late-session earnings on Thursday from J.C. Penney Co. and other retailers kept retail in the spotlight.

Shares of J.C. Penney (JCP) shares soared 16% after the midprice department store on Thursday posted a better-than-expected 6.2% same-store sales gain. J.C. Penney CEO: 'We've turned an important corner' Read: Sterne Agee analysts explain why they're not true believers.

Nordstrom Inc. (JWN) shares jumped 15% after the retailer reported results late Thursday above Wall Street's expectations.

Applied Materials Inc. (AMAT) said it swung to a second-quarter profit from a loss a year earlier, lifting shares 8.1%.

Warren Buffett's Berkshire Hathaway Inc. (BRKA) (BRK/A) bought shares of Verizon Communications Inc. (VZ) and added to its stake in DaVita Healthcare Partners (DVA) according to 13f security filings. Shares in Verizon were up 2.3%.

Shares in General Motors Co. (GM.XX) fell 1% on news Berkshire Hathaway unloaded the stock. Read: GM loses favor with some big investors; interest in Verizon, MGM grows.

European stocks off, oil inches higher

Europe's main stock index, the Stoxx Europe 600 closed marginally higher. In Asia, India's S&P BSE Sensex finished at an all-time high as election results indicated a new government will be lead by the opposition Bharatiya Janata Party.

In other markets, crude oil futures(CLM4) climbed Friday to tally a gain of 2% for the week as a jump in April U.S. housing starts and the coming summer-driving season raised expectations for energy demand.

Gold futures (GCM4) settled with a slight loss on Friday, but still scored a gain for the week.

The dollar fell against the British pound Friday as investors struggled to get a sense of when major central banks could begin to raise interest rates. Read: Why a dollar rally is elusive.

More must-reads from MarketWatch:

Soros cuts his bearish bet on the S&P 500, adds Russell 2000 bear call

Acampora talks of 'sick feeling' and possible 25% slide for some markets

7 reasons Amazon's stock is going nowhere in 2014

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

J C Penney (NYSE:JCP)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more J C Penney Charts.
J C Penney (NYSE:JCP)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more J C Penney Charts.