The last time staples did this, they dropped nearly 20% in three months

Staples stocks are on a tear.

The sector rocketed to a new high this week as names like Kellogg posted better-than-expected earnings.

But if history is any indication, the rapid rise could spell impending doom.

The sector currently trades at 19 times forward earnings, roughly equivalent to the high-growth tech sector. The last time the XLP consumer staples ETF traded at this heightened valuation, in early 2018, it preceded a drop of nearly 20% over the next three months.

Despite the runup, Miller Tabak鈥檚 Matt Maley argues that the sector鈥檚 charts look solid.

鈥淭he chart looks fine. You look at a longer-term chart on the XLP, it made a very nice double bottom in 2018. And then when it bounced off that, it bounced so strong it moved up to a new all-time high, and a meaningful all-time high,鈥 he said Thursday on CNBC鈥檚 鈥淭rading Nation.鈥

But he thinks the sector isn鈥檛 immune to systemic risks in the market, especially since staples currently look 鈥渁 little bit over-owned.鈥

Staples stocks are often referred to as safety or defensive trades since investors tend to pivot into them when they sense risks in other areas of the market or broader economy.

But this time around if the market starts to move lower investors won鈥檛 鈥済o piling into the group like they have in the past because they already own a lot of those names,鈥 said Maley. That means the sector could be 鈥渧ulnerable鈥 to the type of pullback it experienced in 2018.

After the recent push higher, staples now trade at the same valuation as tech stocks, which Strategic Wealth Partners鈥 Mark Tepper believes isn鈥檛 justified.

鈥淭he [staples] are all really expensive, and it鈥檚 really tough to get excited about buying them at these current valuations because you鈥檙e really just paying a lot for companies that aren鈥檛 growing all that fast at all, especially when you compare them to what鈥檚 going on in the tech sector,鈥 Tepper said on 鈥淭rading Nation.鈥 

鈥淭ech is growing earnings at three times the rate of staples,鈥 he continued, and so 鈥渓ooks much more appealing.鈥

Tepper does believe that staples stocks could continue to outperform while there鈥檚 鈥渦ncertainty surrounding the entire economy,鈥 and he thinks Walmartis the most appealing of the bunch since it can outperform in any economic environment.

鈥淚t鈥檚 a huge company that鈥檚 accessible in 90% of U.S. households,鈥 he said. 鈥淚 mean, they鈥檙e literally everywhere, and if the economy slows, it鈥檚 a good place to hide out. The majority of their business is still groceries and people need to eat regardless of what鈥檚 happening in the economy.鈥

Big box retailers traditionally have relatively low margins, but Tepper points to ways that Walmart is making up for that, such as increasing volume and rolling out curbside pickup, which should 鈥渉elp to drive more volume.鈥

The company currently trades at 22 times forward earnings, which he says is a 鈥渂it expensive,鈥 but he added that if investors are looking for some safety in their portfolio, Walmart provides that.