Goldman: Market going nowhere, buy these stocks

Traders on the floor of the New York Stock Exchange.
Brendan McDermid | Reuters

After a 7 percent market rally the last two weeks, Goldman Sachs told clients that the S&P 500 will not go higher the rest of the year as the comeback was driven by low-quality stocks.

But there are still names that can outperform the market, the firm said.

"A momentum reversal rally by definition is powered by sectors and stocks that have been severe laggards, but the rally in lagging cyclicals is not supported by either an improved profit outlook nor by extreme undervaluation. Major market risks between now and year-end support our forecast that the will close at 2,000, roughly unchanged from the present level," wrote Goldman's David Kostin in a note to clients Friday.

Kostin is pessimistic the market can overcome several negative issues in each of the next three months. This month, he thinks the third-quarter earnings season will be disappointing with many companies missing sales targets and lowering guidance. He believes November will be dominated by worries over the federal debt limit. And in the last month of the year, investors will be focused on the potential for a Fed rate hike Dec. 16.

"Given the uncertain outlook, we expect 'quality' stocks will outperform. We define quality to include firms from various sectors that have stable sales growth, low variability in earnings before interest and taxes (EBIT), low price drawdowns, a solid return on equity, strong balance sheets and large market caps," stated Kostin in the report.

Goldman calculated a quality score based on the five factors above. Here are the top "high-quality" stocks in each sector of the market the firm recommends...

More In Investing

CNBC ProHow to invest behind the sweeping climate and health care package that could soon become law
CNBC ProWarren Buffett's stock shopping spree slows down even during market's big pullback. Here's why