S&P 500 snaps four-day losing streak

sp close
Click the chart for more stock market data.

U.S. stocks ended mixed Tuesday, as investors focused on earnings reports from several major retailers.

The S&P 500 broke its four-day losing streak, but the Dow Jones industrial average gave up earlier gains to end lower for the fifth straight day. Both indexes are still up 15% for the year.

The Nasdaq closed slightly higher. So far this year, the tech-heavy index has gained 19%

Click here for more on stocks, bonds, commodities and currencies

J.C. Penney (JCP) posted a big loss that was even worse than the forecasts. Despite that, the struggling retailer noted that its same store sales, a key measure for retailers, were slightly better than they were during the first quarter of 2013. Shares retreated a bit from their highs of the day but were still up 6% at the close.

The retailer's future was a popular topic on StockTwits and some investors questioned why the stock rose in the first place.

duke2duke: $JCP good luck bulls. Buying on the promise of back to school when the numbers showed otherwise. The market is irrational, is what it is. Bearish

racernic: i don't get this obsession w/$JCP.walk away.company in terrible situation trying 2do the improbable. easier trades elsewhere. 2dy as ex

Best Buy (BBY) has also struggled recently, but appears to be a step ahead of J.C. Penney in the turnaround process. The electronics retailer reported a surge in profit, which CEO Hubert Joly attributed to aggressive cost-cutting. The stock has now gained 185% so far this year.

Retailers Urban Outfitters (URBN) and TJX (TJX) were also top performers in the S&P 500 after releasing solid earnings reports.

Home Depot (HD) announced a gain in quarterly net profit and raised its guidance for 2013. Rival Lowe's (LOW) will report results tomorrow.

Home Depot shows housing boom's for real
Home Depot shows housing boom's for real

But not all the reports from retailers were good. Struggling bookseller Barnes & Noble (BKS) recorded a loss and said revenue from its Nook tablet business was down more than 20% from the same quarter last year. The stock plunged and at least one trader on StockTwits had little hope for a rebound.

graubart: I would like Barnes & Noble to survive. But I don't find any benefit to shopping there. And can't see a path to a sustainable future. $BKS

Related: Fear & Greed Index ruled by Fear

Besides earnings, there was little market-moving news Tuesday as investors continue to speculate about when the U.S. will begin to tighten monetary policy.

The minutes from the Federal Reserve's last monetary policy meeting will be closely watched on Wednesday for clues as to when the central bank will begin tapering its $85 billion a month in bond purchases.

More signals could come from the Kansas City Fed's annual conference in Jackson Hole, Wyo., later this week.

Related: Fed provokes fear in emerging markets

European markets were lower, with investors paring back risk before the Fed minutes.

Asian markets were also lower across the board on worries that possible changes to the Fed's bond-buying program will suck capital out of riskier markets.

Shares in China Everbright Securities fell 10% as investors had their first chance to respond to restrictions placed on the broker's activities after trading glitches on Friday and Monday.

Indian stocks fell again as the rupee continued to hit new lows against the dollar.

CNNMoney Sponsors