The stock market’s wild trading recently has raised the specter of a bear market emerging from hibernation. That means it’s time for investors conditioned to buy all declines to be mindful of the “value trap” — a declining stock, sector, or index that appears cheap after a selloff but keeps declining.

Or in Wall Street parlance, when investors try to “catch a falling knife.”

This year’s biggest value trap has been the energy sector — especially companies involved with oil production. From June 2014 through August 17, oil dropped from its peak of slightly more than $100 per barrel, to the low-$40 range, before rebounding to near-$50 on Monday.

The oil price drop has caused energy stocks to suffer as well, making energy the worst-performing sector in the S&P 500 SPX, -1.15% so far this year. The energy sector now comprises around 7% of the S&P 500.

Because of oil’s price decline, both the stocks of the largest exploration and production companies and the largest oilfield service companies have declined precipitously since June 2014.

Still, a number hedge funds and mutual funds waded into the energy sector. A recent report from Reuters indicated that some top value-hunting hedge funds remained bullish on energy stocks in the second quarter of 2015 even as the oil price slump intensified. The A-list funds include Baupost, Greenlight, Jana Partners, Third Point, Magnetar, and Hayman Capital.

Some hedge funds are mixed on the sector. David Einhorn’s Greenlight Capital is long Consol Energy CNX, +0.08% , but Einhorn gave a scathing presentation at the Ira Sohn Conference on many frackers including Pioneer Energy Services US:PES , which he accused of burning through cash. Another notable investor, Jim Chanos of Kynikos Associates, is short larger producers including Chevron CVX, -2.44% .

Winners and losers in China shake-up

One value mutual fund that had a large energy position — around 16% of its portfolio — in late 2014 and early 2015 is Artisan Value ARTLX, -2.37% . The fund dialed back the exposure to 11% by the end of June, but oil and gas producers Devon Energy DVN, -5.21% and Apache APA, -4.26% were still among the fund’s top-10 holdings.

In a June statement about energy, the Artisan managers cited the decision by Saudi Arabia to pump more oil as the largest contributing factor to the price drop. According to the statement, the managers are pricing in $70-$90 per barrel for West Texas Intermediate (WTI) crude CLV25, .

Energy has taken its toll on the fund, which is down 9.2% for the year through August 26, while the S&P 500 is down 4.5%.

A value trap defense

One value fund that has steered clear of the energy value trap is DoubleLine Shiller Enhanced CAPE DSEEX, -2.67% . This is a rules-based value fund with a built-in value-trap defense.

After investing its capital in bonds, the fund uses its bond portfolio as collateral to own derivatives tied to the Barclay’s Shiller CAPE US Sector Index.

This index initially targets the five cheapest sectors of the S&P 500 based on their cyclically adjusted price/earnings (CAPE) ratio, a valuation metric developed by Nobel laureate Robert Shiller. After identifying the five cheapest sectors, the index eliminates the one with the worst one-year price performance.

The DoubleLine fund held energy in the summer of 2014. But less than three months after energy stocks began their decline the price performance filter flashed red, and caused the index to dismiss energy in exchange for consumer staples in September 2014. That move protected the fund from falling into the energy value trap.

Attention to price momentum has served the DoubleLine fund well in 2015, keeping it out of the worst S&P 500 sector and limiting its loss to 2.4 % versus the index’s 4.5% decline through August 26.

As the recent jump in oil prices shows, however, a price performance or “momentum” filter won’t always work, and value investors who’ve stubbornly bought energy on the way down may yet wiggle out of this trap.