After some of the roughest days in the market in years, protecting your portfolio seems a lot more important than it did at the beginning of the year. Warren Buffett's rule No. 1, "Never lose money," is particularly relevant when the market seems determined to kick you in the teeth. But identifying the right defensive strategy can be tricky.

Stop that loss!
One common technique you can use to avoid big losers is a stop-loss. If the stock falls below a certain price, then you automatically liquidate the position. This strategy ensures that a small loss never turns into a big one. Typically, the stop loss price is set 10% below the purchase price. You can ratchet up the stop loss price as the stock appreciates to protect your gains.

If you look at some of the recent blow-ups, a stop loss would have helped you to varying degrees. With Novastar Financial (NYSE:NFI), buyers at $30 could have easily stopped their loss at $27. Not so for owners of New Century Financial (NYSE:NEW). In New Century, the stock closed at $30 one day and opened at $22 the next, so you'd still suffer a 25% loss.

So, one problem with stop losses is that they don't save you from gap openings. An even bigger problem is whipsaws, which is when a stock falls but then recovers to achieve new highs. Consider Monsanto (NYSE:MON). Back in 2003, it fell from a split-adjusted $9 to $7. If a stop loss had kicked in there, you would have missed out on a seven-bagger, as the stock is now above $50.

The biggest problem with the stop-loss strategy is that, in essence, it ensures that you're buying high and selling low. After the stock falls, all else being equal, it should be a more attractive investment, because it's cheaper now than it was before. So, you really ought to be buying. Instead, you're saying "I'll just ignore my analysis and logic, and throw that stock out the window, because the market is smarter than I am." Buy some self-confidence, dude!

Buffett's way
Warren Buffett takes a radically different approach to avoiding losses by building a crash-resistant portfolio. He simply buys stocks that are undervalued and avoids those that are overpriced. The theory is that stocks tend to return to their fair value over the long term. So, if you're buying the stock below its fair value, it's more likely to go up than down. And if it falls, the stock's simply getting more and more undervalued. Thus, a portfolio of cheap stocks tends to be crash-resistant.

Focusing on value works well in practice, too. It's quite hard finding stocks on which Buffett has lost money. Yet minimizing the downside risk hasn't prevented him from identifying huge winners such as American Express (NYSE:AXP) and Moody's (NYSE:MCO). The key isn't whether the company has a high growth rate or not; it's whether the stock is trading at a good price relative to its assets, growth rate, and competitive position.

Identifying cheap stocks is our goal at Inside Value, and that strategy has worked well for us, too. We recommend two stocks every month, and last year, only two stocks we recommended lost money. And as you'd hope, buying undervalued stocks didn't hurt our returns. We're beating the market, and one of our 2006 picks, MasterCard (NYSE:MA), returned 120% in less than a year.

The Foolish bottom line
Stop losses are probably most appropriate for traders. For long-term investors, it makes more sense to focus on understanding the stocks you own, and only buying stocks for less than their fair value. If you're trying to build a crash-resistant portfolio and are looking for ideas, check out our Inside Value newsletter. You can get a free pass here.

Fool contributor Richard Gibbons knows through bitter experience that one should not taunt koalas. He does not have a position in any of the stocks discussed in this article. Moody's is a Motley Fool Stock Advisor recommendation. The Fool has a disclosure policy.