I recently wrote about one of my investing mistakes, which was actually more like a comedy of errors. It involved a penny stock that I purchased over 10 years ago based off of a message board poster’s advice. Of the many mistakes that I made, one was that I did not have an exit strategy when I purchased the stock. As a result, after I sold my initial investment, and the stock’s price kept rising, I actually bought more because I felt that I was missing out on more profits.

While exit strategies are tied to the type of investment, all investments should have an exit strategy. This is because, we as investors, are very poor at timing the market. As I mention almost every article it seems, if the Ivy league MBAs running the world’s mutual funds and hedge funds cannot consistently beat the market, then we shouldn’t expect to either, and we certainly shouldn’t expect to be able to time the market consistently well. There is a whole field called “behavioral finance” that seeks to describe and explain this phenomenon, but the simple version is that our brains are our own worst enemy in many cases when it comes to investing. This is why we need a written exit strategy, so that we can more objectively make a good decision, planned well in advance, of when to sell a security, rather than rely on emotions, instinct, and everything else that tends to betray us.

The hardest but most necessary situation to have an exit strategy is for private investments, such as into your practice, office building or surgery center. Physicians should make sure that their bylaws, operating agreements, or other applicable governing documents clearly spell out when a physician can sell his or her interest, the purchase price (or how it is calculated) and the payment terms. Without a clear exit strategy, it is very possible to be stuck in an unwanted investment indefinitely or have to sue to force your way out.

Even buy-and-hold investors need an exit strategy, even though they plan on keeping their holdings for years or even decades. In that case, the exit strategy might be that upon reaching a certain age, amount saved, or a number of years prior to retirement, riskier investments might be sold or trimmed-down in exchange for less risky investments. Another situation might be that mutual funds and ETFs should be reviewed every year or so to make sure they are the lowest-cost, best fit option available. If not, then make sure that the trading costs and taxes on changing investments are not greater than the benefit from switching.

As for momentum-based investing, one of its strengths is that it has a built-in exit strategy, in terms of selling the ETF or mutual fund once the momentum (such as price of the ETF compared to its 200 day moving average) becomes negative. This takes away the guess work and emotion involved with investing, especially when the asset class appears to be irrationally priced. Also, when the investor buys back into a particular asset class later, that is a great time to make sure to select the best ETF or mutual fund.

For individual stocks, the exit strategy can be as simple or complicated as you want it to be. With my personal individual stock purchases, I mostly invest in dividend-paying stocks and I subscribe to the theory that value and momentum are two significant (and inversely correlated) drivers of investment performance. As a result, when a stock becomes overvalued, I wait for the momentum to become negative, and then I sell the stock (provided it is still overvalued or at least fairly valued). For example, since I purchased Facebook stock in 2013, it has not traded below its 200 day moving average. During much of this time, I have considered it overvalued, but it has more than doubled since I put it on the sell list, and I plan on holding it until it is both overvalued and trading below its 200 day moving average.

I also consider whether the company has cut or stopped raising its dividend, made a fundamental change to its business model, or has changed its capital allocation strategy in a manner I disagree with. What a company does with its free cash flow is key, since one of the greatest drivers of our gains or losses as investors comes from how that cash flow is utilized.

Finally, I can’t write about exit strategies without mentioning a trailing stop-loss trade.  A trailing stop-loss is a form of trade entered with your broker in which is the stock is sold if it drops a predetermined percentage amount from its recent high (as of when you enter the trade). If the stock’s price continues to go up, then the sell point will rise as well.  Stop-losses are a more passive way to take advantage of momentum, as you do not have to keep an eye on the ticker symbol for the trade to occur, and it works especially well if you are going to be away from your computer for a few days and want to decrease your risk with some holdings that you are willing to sell. One of the weaknesses of stop-loss trades is that with volatile stocks, or in flash-crash type situations, a stop-loss could be triggered, causing your stock to sell, but then the stock’s price could quickly rise past the sale amount, making the trade regrettable. Another is that once the stop-loss is triggered, the sale price will not necessarily be exactly at the stop-loss amount, but rather, if the price continues to drop, then the trade may occur at an even lower price.