At the 1998 Berkshire Hathaway (NYSE:BRK.A) (NYSE:BRK.B) annual meeting of shareholders, one audience member asked Warren Buffett (Trades, Portfolio) if he could outline the criteria Berkshire uses to decide when to sell a stock.

Buffett’s answer to this complex question was simple. He stated that the best time to sell an investment was “if you need money for something else.”

The best time to sell

Buffett gave this answer because he believed that the most significant mistakes he has made over the years are not bad investments, but “mistakes of omission.” These mistakes don’t show up in Berkshire’s investment returns, but they are a genuine opportunity cost for the group and its investors.

Buffett’s right-hand man and vice-chairman of Berkshire, Charlie Munger (Trades, Portfolio), elaborated on this topic at the group’s 2001 annual shareholder meeting, saying, “The mistakes that have been most extreme in Berkshire’s history are mistakes of omission. They don’t show up in our figures. They show up in opportunity costs.”

Munger went on to give an example:

“I don’t like mentioning the specific companies, because the — you know, we may, in due course, want to buy them again and have an opportunity to do so at our price. But practically everywhere in life, and in corporate life, too, what really costs, in comparison with what easily might have been, are the blown opportunities. I mean, it just — it’s an awesome amount of money. When I was somewhat younger, I was offered 300 shares of Belridge Oil. Any idiot could’ve told there was no possibility of losing money, and a large possibility of making money. I bought it. The guy called me back three days later, and offered me 1,500 more shares. But this time, I had to sell something to buy the damn Belridge Oil. That mistake, if you traced it through, has cost me $200 million. And I — it was all because I had to go to a slight inconvenience and sell something. Berkshire does that kind of thing, too. We never get over it.”

This is something to keep in mind in times of market stress. Deciding when to sell an investment is possibly one of the hardest parts of investing, especially when the market is falling several percentage points every day.

Two reasons to sell

Buffett’s comments (both from 1998 and on other occasions) suggest that there are only two reasons why investors should sell an investment: to raise cash for a new opportunity or because the situation has changed. Indeed, as Buffett once said:

“Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.”

Sticking your head in the sand and hoping for the best isn’t an investment strategy. It is bound to lead to losses or underperformance over the long run.

As an investor, it is important to acknowledge the fact that you will never be right 100{e0233a5a8ca3dab8ed448c5451aba2c38c77d167988a5d203483ecea09d61312} of the time. Sometimes, it is better to sell a losing position to take up another opportunity elsewhere.

The primary aim of investing is to produce an attractive return over the long term without suffering a permanent capital impairment. This does not, however, mean that investors should seek to avoid losses at all costs. Sometimes, losses are necessary. In fact, taking a loss can be beneficial from a long term perspective. Selling a losing position will allow you to reinvest your capital in something that might generate a better performance.

Psychologically, this is going to be difficult. Humans feel losses more than profits. Therefore, it’s vital to keep Buffett’s advice in mind: don’t get emotional and focus on the fundamentals. Your portfolio will thank you over time.

Disclosure: The author owns shares in Berkshire Hathaway.

Read more here:

Not a Premium Member of GuruFocus? Sign up for a free 7-day trial here.