Buying stocks and selling stocks are the two most crucial moments for any investor. And for me, knowing when to sell is the toughest part of the whole process.

Warren Buffett tells us to "be fearful when others are greedy, and greedy when others are fearful." But how do we know when others are being fearful or greedy enough to make a move?

The fun part: jumping in the water
To me, searching for the next great stock is the most fun part of investing. I like researching a company's products, searching for a value, discussing (or arguing) it with friends and colleagues. And when everyone thinks a stock is garbage, I love being the one who sees its true value. Even if my timing is wrong, I can always buy more and bring my average cost down.

That formula has succeeded for me over the years, but there's more to investing than finding a great stock and buying it at the bottom. Buying isn't easy, but I think it's easier to spot fear than it is to see greed. Especially when you have a winner, letting go is the hardest thing to do.

In the past two years, I have owned and sold four stocks for a very good profit, only to watch those stocks scream higher than I could have imagined. In retrospect, I made great buying decisions with Apple (Nasdaq: AAPL), Las Vegas Sands (NYSE: LVS), and Chipotle (NYSE: CMG), but let go of each one far too early. In my latest selling blunder, Melco Crown (Nasdaq: MPEL), I waited until other casino stocks looked much more attractive before I sold. Alas, I then watched Melco's stock climb nearly $4 higher than the covered call options I sold.

But the past is the past, and those lessons help me look back on what I learned in the process. Sometimes I need to look at more than valuation when selling, and keep an eye on investor sentiment and momentum to tell whether I'm getting out too early.

Valuing the chips you own
No matter what valuation formula you use, I could give example after example of companies that have blown past any metric I might define as a great selling point.

Netflix (Nasdaq: NFLX) exemplifies everything that simple valuation doesn't tell us about when to sell a stock. The company's P/E ratio is through the roof. Potential competitors like Apple look more attractive on almost every level. Yet after outperforming the market for years, the stock just keeps going higher.

When I said I would sell Netflix nearly a year ago, I thought it was a great time to get out. My colleagues at our Stock Advisor newsletter held firm on their recommendation to buy the stock. Since then, the stock has more than doubled. Boy, was my timing off!

So while we need to keep an eye on valuation, it isn't always the best metric, because psychology plays a big role in investing.

Momentum that never ends
When I think of long-standing momentum, Las Vegas Sands and Sirius XM (Nasdaq: SIRI) immediately spring to mind. Both companies' stock has enjoyed outstanding performance over the past two years, and both reveal how momentum plays into the market.

Las Vegas Sands' chart goes almost straight up from the bottom of the financial crisis until November 2010 -- yet it's gone nowhere since then. Is the momentum gone, or has the stock just caught up with the company's true valuation? When I add valuation into the mix, I would argue that Las Vegas Sands is priced right -- but until that momentum stopped, I shouldn't have even thought about selling shares.

Sirius XM has been on a similar tear. The stock is climbing higher, and investors are eagerly awaiting Sirius XM 2.0. Even if I think shares are overvalued, this run doesn't look like it's over.

Perception is reality
One of my favorite ways to tell whether a stock has topped out involves watching how investors react to different viewpoints on the stock. At The Motley Fool, we're always posting different opinions, and readers don't hesitate to tell us if they think we're off-base or spot-on with our analysis. When the sentiment turns, it's time to reevaluate.

You can also watch our ratings on stocks in CAPS to see how investors are feeling. Our investing community can help you harness the collective opinions of hundreds or even thousands of people.

What I've learned
Certain strategies, like using options and buying and selling at multiple points, can also take some of the pain out of timing a stock sale. When IMAX (Nasdaq: IMAX) went on a tear in late 2010, I took about 30% of my investment off the table. The stock had about doubled when I bought it, so in just a few months, I had cashed out about 60% of my original investment. From there, I could still profit if the stock went up, but I wasn't going to lose my shorts if it went down. Sometimes, a little psychological security is just as important as squeezing out a little more profit.

Perhaps most importantly, I've learned to step back and observe how valuation, momentum, and investor sentiment affect a stock. Just because you have a good profit doesn't mean it's time to sell. There may still be more money to make.