Traders work on the floor of the New York Stock Exchange.

The retail bull has been among the loneliest of investors this year.

The apparel retail subset of the S&P 500 is down about 17 percent this year as the broader market has gained 8.5 percent and the world became all the more enamored with digital.

Tech isn’t just a flashier sector, it’s started to eat retail’s lunch. Amazon shares topped $1,000 and, albeit briefly, made Jeff Bezos the world’s richest man. Profit, sales and footfall in brick-and-mortar stores has retreated steadily, and big-name retailers — from Macy’s Inc. to Abercrombie Fitch & Co. — are shuttering stores.

In a nutshell, consumers have started shopping more online and when they do venture out, they’re looking for selfie-ready experiences rather than more stuff to pile into the closet.

Retail for a time became what many saw as “un-investable.” Things looked so bad overall that many investors painted the whole sector with one brush and shied away.

Simeon Siegel, Instinet retail stock analyst, said last week, “Any good company is now very expensive and any cheap company is cheap for a reason.”

But there is a way to bet on the future, it just takes a nuanced approach.

“One recurring them is brands over boxes,” Siegel said. “The companies that survive are the companies that can survive alongside Amazon. The obvious ones are brands, they can utilize Amazon as distribution. Brands are much better situated to adapt to the new normal than retailers.

“The boxes [or stores] that can win, are the boxes that have buy-in from vendors, so vendors want them to survive, that’s more beauty, than others,” he said, pointing to Ulta.

Another store that is positioned to keep up gains in spite of the Amazon onslaught is off-pricer Ross Stores Inc. Siegel noted that only one-third of Ross’ business is conducted through credit cards, that the store caters to a lower-income demographic and that it has a lower average ticket, with individual sales averaging about $10.

Although structural shifts, particularly the rise of e-commerce, remain, there have been some signs of hope. Wal-Mart Stores Inc., Kohl’s Corp., Target Corp., TJX Cos. Inc. and others have said foot traffic is gaining momentum. And consumers do have the power to spend — although there are fears that if the high-flying stock market does come down, they’ll start to feel a little poorer.

With so many broad trends sweeping through the system and threatening to upend the sector, it’s become more of a stock picker’s market.

Ike Boruchow, a Wells Fargo retail analyst, said, “Any type of sustained upside in our space will likely be much more company specific going forward….We’d now be less vocal on the potential for a sustained rally, but rather would look for specific names/setups to find upside [or downside].”

More from WWD: 

Retail Foot Traffic Tiptoes Back

Heeling Power: Shoes Kicking at High, Low End

Vegas Serves as Reminder of an Industry in Transition