There is no shortage of strategies for buying stocks. You could take a quick trip to your local library and come home with a pile of books about value and growth investing. You could also hop on the internet and find subscription services telling you which stocks to buy or blogs about the stocks people bought. Unfortunately, there is a shortage of good information about when to sell stocks.

There are many reasons to sell a stock, and sometimes those reasons have nothing to do with the stock itself. For instance, selling stocks can be part of an investor’s retirement plan. In another scenario, an investor may plan to leave stock to an heir. In that case, they never sell the stock.

Let’s face it; there is a lot to consider when selling stocks. There are many reasons to sell a stock, and not all of them apply to everyone. So, let’s dive into a few of them.

How to know when to sell a stock.

When to Sell Stocks

If you’re thinking about selling stock from your account that has increased in value, it can be tough to decide when to sell it. One of the first things to consider is opportunity costs. Opportunity cost is what you’re giving up by making a decision.

For instance, consider what you’ll do with the proceeds if you sell your stock. If you don’t have a plan or your next stock idea isn’t as appealing, you might want to keep the stock. On the other hand, if you use the proceeds to buy another stock that you think is a great idea, you should probably sell the stock.

Some value investors are very serious about stock valuation. In stock valuation, the investor determines an approximate fair value for a share of stock. When the stock price falls significantly below its fair value, the value investor buys the stock. Since the value investors already know a fair price for the stock, they can use the fair value price as a predetermined selling price.

For instance, say you like ABC Company, and you think their stock is worth $100 based on fundamental analysis. You then see that ABC stock is trading at $50. You decide that is a great value and buy shares. Because you believe the shares are worth $100, you hold them until they reach $100 and sell them.

Retirement Planning

You may have a financial advisor. If that is the case, the financial advisor has probably put together a retirement plan for you. Part of the typical retirement plan is to allocate a specific percentage of your money to stocks and a percentage to bonds.

The prices of the stocks and bonds in your portfolio will change over time. Periodically, your financial advisor will rebalance your accounts to the original percentages. If the stocks in your portfolio have outperformed the bonds, your financial advisor will sell stocks and buy bonds in the rebalance. Regularly rebalancing your accounts is a hands-off way to keep the allocation you initially decided on with your financial advisor.

Suppose you’re fortunate enough to make it to retirement. Since you’re no longer earning a paycheck, you must sell stocks or bonds from your accounts to pay for living expenses. Your financial advisor can keep your allocation to stocks and bonds by selling the assets that have gone up. You can keep your allocation close to your predetermined levels by doing this.

When to Sell Stocks: Tax Considerations

If the stock you’re thinking about selling it in a taxable account, make sure you think about taxes before you sell. Investors owe capital gains taxes when they sell stock. There are two types of capital gains taxes, short-term and long-term.

Investors pay short-term capital gains taxes when they sell a stock a year or less than a year after buying it. The rates that taxpayers owe for short-term capital gains are similar to regular income tax rates. On the other hand, you can deduct that amount from your taxable income if you sell a stock at a loss a year or less after you bought it.

If you keep your stock for more than a year, you’ll pay long-term capital gains taxes when you sell the stock. The long-term capital gains rate you’ll pay is also based on your income. You pay a lower tax rate on long-term gains than on short-term gains.

Like short-term losses, you can deduct long-term losses from your taxable income. Please consult your tax advisor for more details.

Don’t Be Emotional

Sometimes the stock market can suffer big downturns. When that happens, your stocks will probably suffer also. Often investors panic in this situation and sell stocks based on negative emotions. It may be painful to watch your stocks fall. However, you’ll want to make sure you stick it out when stock markets bounce back.

In fact, when stock markets crash, it is usually the best time to buy stock. When the market is down, buying stocks will put you in a better position to take advantage of the next recovery.

Famous investor Warren Buffett said, “My favorite holding period is forever.” In other words, buy stocks of great companies and hold them for as long as you can!