Shares of microcap stocks have surged to  record highs, far outpacing the broader market, and that may be a bearish signal. Matt Maley, equity strategist at Miller Tabak, notes that these small companies tend to be much riskier than their larger counterparts, and excessive risk-taking tends to associated with market tops. "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 to CNBC

According to Maley, since 2007 there have been six previous instances when the iShares Microcap ETF (IWC) outperformed the S&P 500 Index (SPX) over the course of several months. In five of those six cases, he notes that the S&P 500 reached a top relatively soon thereafter. "It's not a perfect indicator but it does tell me that we may 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," he said.

Driving Forces

The iShares Microcap ETF had an all-time record high close on June 6, up 12% year-to-date. By contrast, the S&P 500 has advanced by 3.7%, but is down by 3.5% from its own record high close on Jan. 26. Microcap stocks are generally defined as those with market capitalizations between $50 million and $300 million. Per CNBC, the iShares ETF includes the 1,000 smallest stocks by market cap in the Russell 2000 Index.

Stacey Gilbert, the head of derivative strategy at Susquehanna Financial Group, told CNBC that a strong U.S. dollar, a robust domestic economy and tax reform have been key drivers of microcap outperformance. Citing data from Bloomberg, she notes that 92% of revenues for microcap companies as a group comes from the domestic market. By contrast, a rising dollar hampers exports by more internationally focused U.S. companies, while causing the overseas earnings of multinationals to be translated into fewer dollars.

'Open Up the Hood'

Gilbert advises investors to be selective when considering microcap stocks. "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," she told CNBC. "I would be picking my favorite stocks in microcaps rather than buying something broader so that I know my risks going into it," she added.

The five biggest holdings in the iShares ETF as of April 30 were:

Company Ticker % of IWC Portfolio YTD Gain
Arena Pharmaceuticals Inc. ARNA 0.48% 41%
Immunomedics Inc. IMMU 0.48% 56%
AnaptysBio Inc. ANAB 0.43% (25%)
Heron Therapeutics Inc.  HRTX 0.41% 82%
Enanta Pharmaceuticals Inc. ENTA 0.37% 83%

Source: The Wall Street Journal; YTD gains calculated through June 6.

The recent woes of AnaptysBio illustrate the risks inherent in microcap companies. Shares of biotech firm hit a record high on March 2 and have fallen by 41% since then. According to The Motley Fool, promising results from trials of treatment for eczema propelled the stock to that high. Then came news that the same drug, when tested as a treatment for peanut allergies, was proving to be less promising. Despite the fact that the second trial was very small in scope, and was limited to adults, analysts were disappointed, The Motley Fool indicates.

Meanwhile, Aimmune Therapeutics Inc. (AIMT) released very upbeat results from its own trial of a peanut allergy treatment, and worries over competition starting weighing on AnaptysBio. This is despite the fact that, as The Motley Fool observes, Aimmune's trial included children, but no adults, while AnaptysBio still had a promising eczema drug in the works.