Microcaps just hit an all-time high. That's a good sign of investor confidence in riskier assets, but it could also be setting the markets up for a fall, warns one strategist.

When the more volatile IWC iShares micro-cap ETF outperforms over several months, the tends to top out shortly after, Matt Maley, equity strategist at Miller Tabak, told CNBC's "Trading Nation" on Tuesday.

"People add more risk and they throw caution to the wind and that's usually something we see at the end of the cycle, not at the beginning," he said.

The IWC's outperformance preceded a top in the S&P 500 in 2007, another in 2010 and 2011, and again in 2015 through early 2016, said Maley.

There are exceptions to the rule, he noted. In 2014, for example, the IWC outperformed but did not pave the way for a correction in the S&P 500.

"It's not a perfect indicator but it does tell me that we might be getting to see another hiccup in the market sometime in the next couple of months kind of like what we saw back in February," said Maley.

Stacey Gilbert, market strategist at Susquehanna, says a strong U.S. dollar and robust domestic economy could keep the rally in microcaps going. Given more than two-fifths of microcap revenue is generated domestically, the group tends to outperform against multinationals when the dollar is strong.

However, Gilbert advises employing stock selection when navigating the microcap space.

"Like all ETFs, you have to open up the hood to figure out what's actually in there and some of the liquidity of some of these smaller-cap names can be very tight," said Gilbert. "I would be picking my favorite stocks in microcaps rather than buying something broader so that I know my risks going into it."

The IWC ETF hit a record high Wednesday in its sixth session in a row. The ETF, which houses the 1,000 smallest stocks of the Russell 2000, has risen by nearly 12 percent in the year to date. The large-cap S&P 500 has added just more than 3 percent.