As investors scour the financial media, they come across investment ideas that appear to be winning moves. It's hard enough to know which of the ideas hold merit, but even when you decide to pull the trigger and buy a stock or a fund, you're faced with another challenge:

When is the right time to sell?

I've come up with four guideposts that will help you answer that question:

1. What Initially Drew You To The Company Has Changed Dramatically.

We all buy stocks or funds based on certain virtues. A company may have just hired a bright executive, launched a hot product or developed strategies to tap new international markets. But what happens when that new CEO abruptly leaves? Or the hot new strategy is a dud in the marketplace? Or international sales fail to develop? If those are the reasons that you bought the stock, then it's time to sell.

This is known as 'thesis drift.' Investors tend to rationalize bad news and come up with fresh reasons to still like a stock: Indeed, companies tend to pair bad news with good news, glossing over the tough reality. 'We stumbled badly with the last product, but think we have another great product to release to the market in coming months,' they'll say. Frankly, companies that raise investors' hopes and repeatedly dash them already have lost the trust of most other investors, and you should remain dubious as well.

2. The Company Is Now Worth Far More Than Its Peers.

Unless you intend to buy and hold an investment for a very long time, you need to have a clear sense of what an investment is worth. The easiest way to gauge an appropriate value is to compare the stock to its peers. If all of the companies in the same peer group have similar growth rates and have similar levels of profits, but your particular stock has risen in value and now has a price-to-earnings (P/E) or price-to-cash-flow valuation that is higher than the peers, then you've likely scored all of the gains that you will see in the near-term.

The best investors tend to buy stocks of high-quality companies when they are out of favor (or have fallen in price) and they tend to sell those same stocks after they have produced great returns. That's where the phrase 'good company, bad stock' comes from. It's hard to part with winning investments, but even great investors like Warren Buffett do so every day.

As a good rule of thumb, try to figure out what you think a stock's true worth should be. (You can learn how by reading The #1 Rule Every New Stock Investor Needs to Know and our article on how to Find Bargain Stocks Like Buffett With These 4 Value Ratios.) If a stock rises up above its perceived 'fair value,' it may be time to head for the exits.

3. Your Stop-Loss Limits Are Rapidly Approaching.

On occasion, you'll notice that one of your stocks is slowly losing value, though you are unsure why it's happening. There is likely a good reason for it. For example, some investors may have learned that a rival has launched a more impressive product. Or perhaps the stock is getting caught up in a broader market downdraft that could quickly spiral into a full-fledged bear market.

To prevent a stock price meltdown, many investors place stop-loss limits on their stocks, usually at prices 10% to 20% below the current price. Some investors like to 'keep their stops tight,' which means raising this stop-loss limit in tandem with a rising stock price. For example, a stock that has risen from $20 to $27 may see the stop-loss limit raised from $18 to $24. Click here for a fuller explanation of stop-loss limits.

4. Your Gut Says The Stock Has Become Too Risky.

As an investor gets closer to retirement, a portfolio should take a more defensive posture. That means fewer high-growth stocks and more income-producing investments and value-oriented stocks. That makes the decision on which stocks to sell a bit easier. If you own shares of a high-flying tech stock that has surged in value recently and you are within five years of retirement, it may be wise to sell off this winner and re-deploy the assets into a more boring, but safer, stock or fund.

The Investing Answer: Selling stocks and funds that have performed well is counter-intuitive. Investors like to 'let their winners ride.' Yet a decision to sell an investment that has performed poorly and has already lost a lot of value may also seem unwise. But you need to continually assess the relative value of each if your investments, whether the news has been good or bad.

As a silver lining, these stock sales enable you to free up cash for the next time that bargains appear in the market.

As a broader rule of thumb, followed by Warren Buffett and many others, the best time to sell stocks and funds is when the market has moved steadily higher for an extended period. And the best time to load up on stocks is after the next market pullback. Buying low and selling high is still the name of the game.