Stocks closed higher as strength in defensive stocks shook off early morning losses following a measure to cool China’s real-estate bubble, including higher down payments and mortgage rates on second homes in cities and a 20% capital gains tax on sales of existing homes. Also, investors remain optimistic about the economy even as federal spending cuts begin to take hold. Tech stocks followed the broader market with Yahoo, Lexmark and Groupon posting notable gains, but Netflix remained one of the tech sector’s top decliners. Yahoo and Lexmark gained 3.46% and 2.98% respectively after Barclays analysts raised their ratings on the stocks. Netflix gave up 4.3%, after a spokesman for Netflix told the AllThingsD blog that the company has no current plans for an app to run on the BlackBerry 10 operating system. Apple, Nokia and BlackBerry recorded notable losses after several analysts raised concerns about sales of their latest and upcoming devices. In the evening trade J.C. Penney slid 2.8% after CNBC, citing sources, reported that Deutsche Bank is offering a 10 million block of J.C. Penney shares at between $16.40 and $16.60.