By Anora Mahmudova, MarketWatch

NEW YORK (MarketWatch) -- The U.S. stock market closed marginally higher on Tuesday, after retreating from intraday highs set in early morning trade. The benchmark S&P 500 traded in a narrow range the entire session amid low volumes, according to FactSet.

Still, the S&P 500 and Dow Jones Industrial Average closed at record levels for the second straight day.

The S&P 500 (SPX) finished less than a point higher at 1,897.45. The Dow Jones Industrial Average (DJI) rose for the fifth consecutive session and closed 19.97 points, or 0.1%, higher at 16,715.44.

The Nasdaq Composite (RIXF) ended the day down 13.69 points, or 0.3%, at 4,130.17.

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

"Retail sales data were soft, but still pointed to modest signs of improvement in the economy," said Terry Sandven, chief equity strategist at U.S. Bank Wealth Management.

Sandven, who had written about U.S. equities in a slow growth environment, said that recent rallies in cyclical stocks might signal bottoming or near bottoming of the rotation into defensive stocks.

"We expect cyclicals to outperform from here on and broader markets are likely to move sideways with an upward balance," he added.

Investors had several economic reports to asses on Tuesday. The most important among them was retail sales, which were softer than expected. American consumers barely increased spending at retail stores in April after splurging in March following a brutally cold winter. Sales at retailers rose a scant 0.1% in April, the Commerce Department said Tuesday.

Ian Shepherdson, chief economist at Pantheon Macroeconomics, wrote that a late Easter this year boosted core sales in March and depressed them in April.

Inventories at U.S. businesses rose 0.4% in March, slightly below forecasts, the Commerce Department said Tuesday.

The prices paid for imported goods fell a seasonally adjusted 0.4% in April after a revised 0.4% gain in March, the U.S. Labor Department said Tuesday.

Separately, small-business sentiment in May rose to the highest level in more than six years, the National Federation of Independent Business said Tuesday.

Keurig jumps, Elizabeth Arden plummets on earnings miss

In corporate news, shares of coffee-machine maker Keurig Green Mountain Inc. (GMCR) jumped 7.6% after an SEC filing showed that Coca-Cola Co. (KO) increased its stake in Keurig to 16% from 10%.

Rackspace Hosting Inc. (RAX) shares jumped 7.7% after the cloud-computing provider late Monday reported first-quarter earnings that topped estimates. Per-share earnings came in at 18 cents on sales of $421 million.

Shares of McKesson Corp. (MCK) rose 3.2% after the pharmaceutical distributor posted better-than-expected adjusted earnings for the fourth quarter.

Elizabeth Arden Inc. (RDEN) plummeted 16% after the beauty-products company reported weaker-than-expected results.

Shares of home builder stocks rallied after news that Fannie Mae (FNMA) and Freddie Mac (FMCC) won't have to lower the limits for home loans that they back. D.R. Horton Inc. (DHI) closed up 2.2%, Lennar Corp. (LEN) added 1.4%, and PulteGroup Inc. (PHM) rose 1.4%.

China, German data disappoint

In overseas markets, the Shanghai Composite Index eased 0.1% after data were released showing China's industrial production slowed in April while retail-sales growth also fell in March. Both sets of data slightly missed forecasts. (Read more in the Asian Stocks recap blog: http://blogs.marketwatch.com/thetell/2014/05/12/asia-stocks-live-blog-rallying-into-china-data/?link=instory.)European stocks closed higher.

Across other markets, crude-oil futures for June delivery (CLM4) rose sharply, while gold for June delivery (GCK4) fell. The ICE dollar index (DXY) was slightly higher at 80.12.

More must-reads from MarketWatch:

Corporate bond rally is next to bust, some fear

Higher rates are coming -- here's how you prepare

ETFs are becoming 'less of an embarrassment' for professional stock pickers

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

Keurig Green Mountain, Inc. (NASDAQ:GMCR)
Historical Stock Chart
From Feb 2024 to Mar 2024 Click Here for more Keurig Green Mountain, Inc. Charts.
Keurig Green Mountain, Inc. (NASDAQ:GMCR)
Historical Stock Chart
From Mar 2023 to Mar 2024 Click Here for more Keurig Green Mountain, Inc. Charts.