While Wall Street was putting out flames in tech earnings, one sector has had a stealth rally to lead the .

Health care stocks are not only the best S&P 500 performer in the past month, rallying nearly 7 percent, but they're also closing in on record highs set in January.

Matt Maley, equity strategist at Miller Tabak, says the group has more room to run.

"Overall they look quite good," Maley told CNBC's "Trading Nation" on Friday. "Look at the XLV, and it's been making a nice series of higher lows and higher highs. The same thing in the IBB biotech chart, it's been doing the same thing."

The XLV health care ETF has had a strong summer. Since the end of May, it has rallied 9 percent and is just a 2 percent rally from an all-time high set on Jan. 29.

"If these two ETFs can take it one step further and move above their January highs and the IBB is very close to doing that, it's going to give it even more momentum," added Maley.

The IBB biotech ETF is still 2 percent lower than its 52-week highs set last week. It is up 10 percent for the year.

"If you see areas like the FANGS and some of these others see a downdraft, that money I think it will continue to flow into some of these health-care names," Maley said, referring to Facebook, Amazon, Netflix and Google parent Alphabet.

Gina Sanchez, CEO of Chantico Global, sees a shift in the market that could be a tailwind for health-care stocks.

"What we're seeing right now is seeing a general rotation, not just from technology to health care, but really from growthy stocks to sort of more robust stocks," Sanchez told "Trading Nation."

Value stocks often see a boost when investors anticipate any economic weakness. Value stocks prioritize cheaper valuation relative to the rest of the stock market, while growth stocks overlook high premiums in favor of expected profit and sales acceleration.

"Our view is that we're kind of peaking out. The market is starting to get more defensive, it's happening very subtly, but you're seeing value start to become more attractive and you're seeing staples, health care, these kinds of sectors are becoming very, very attractive," said Sanchez.

The health-care sector is the third-best performer on the S&P 500 this year, behind information technology and consumer discretionary.