This article is part of the Real-Money Stock Picks portfolio series.

Judging by the number of discussions on the topic I see among members of Motley Fool Stock Advisor, one of the most difficult decisions for investors is when to sell. Our favorite answer is "almost never, except if the thesis breaks down, you made a mistake, or you need the money elsewhere." But that doesn't always work. Then what? How do you learn when to sell? Well, why not track the companies you sold to see if the decision was well-made or not?

Track your selling
One investor I admire is James Montier of GMO. In one of his writings, he talks about the difference between outcomes and processes when evaluating decisions, arguing that outcomes should be used only as feedback about the correctness of the process used to make a decision, not on the correctness of the decision itself.

For instance, in this context, seeing the stock price fall after selling does not make selling a "good" decision, nor does a rising stock price after selling make it a "bad" decision. Rather, it's the process used to make the sell decision that is good or bad, and the outcome merely feeds into evaluating that process. Montier argues that by improving the process, we'll get favorable results more often. (For a more detailed discussion, see this PDF file.)

As part of doing this for myself while running a real-money portfolio for The Motley Fool, I'm tracking my sells for three years after the sold date, looking at each yearly interval, as well as the locked-in results. Except for two holdings I had to sell because they were acquired, I've sold four different positions. Here's one lesson from each of those four sales.

Don't get impatient
Specialty vehicle-manufacturer Oshkosh (OSK -0.40%) was bought on 12/28/10 and sold on 10/18/11 at a 45.1% loss. On 10/18/12, that would have been a 14.1% loss (up 56.5% since sold), and on 10/18/13, I would have had a 50.9% gain on the original position (up 175% since sold). Currently (i.e., as of last night's close), I would be sitting on a 40.3% gain on the original position, if I hadn't sold.

The reason for selling I gave at the time was that weak results were leading to several metrics that looked disappointing. To some extent, there was also impatience in that many of its sales were to municipalities and sales growth just wasn't happening there. Looking back, I should have realized that, duh, many of its customers were still struggling coming out of the recession. Revenue from access equipment has grown 52%, and commercial equipment has grown by 10% since the end of fiscal 2011. (Of course, its defense sales have dropped by 30% since then.)

Lesson: Be patient when macro events affect a company, as these events change over time.

Know its advantages
Electronics and LCD-maker NamTai Electronics (NTP) was bought on 3/10/11 and 3/31/11. The two positions were sold on 6/21/11 and 6/13/12, respectively, at 24.5% and 18.8% losses. One year later, they would have been a 23.4% loss and a 10.7% gain. At the two-year mark, the first position would still have been down 16.2%. As of now, they would have been a 3.7% loss and a 9.1% gain, respectively.

The first sale was because I realized the position was too big for what I felt the investment risk level was, and the second sale was because I finally realized that the company doesn't have a sustainable competitive advantage. The turnaround in the share price since I sold was mostly because it became known that it was an Apple supplier. Shares climbed sharply a bit after the second sale, and a hold would have resulted in nearly 100% gains on each at that point. That magic has mostly gone away since then.

Lesson: If you don't understand its advantages, stay out.

Accept what happens
Discount grocer SUPERVALU (SVU) was bought on 2/1/11, 10/14/11, and 6/24/12, mostly because I wanted to take advantage of a turnaround effort. All three were sold on 8/3/12 at 64.8%, 68%, and 46.5% losses, respectively, because by then I felt it was a busted turnaround in danger of going bankrupt. On 8/3/13, those had reversed to 11.5%, 1.2%, and 69.6% gains, thanks to what I consider the last-minute rescue by an outside investor basically saving the company. Currently, there would have been 10.8% and 19% losses and a 35.6% gain, respectively, on the three positions.

I still think the sell decision was the right one, because I believe the rescue came out of left field and could not have been foreseen.

Lesson: When the thesis breaks down, time to lick your wounds and move on, even if an angel appears.

Don't be blind
Dendreon (NASDAQ: DNDN), the maker of prostate-cancer drug Provenge, was purchased on 8/11/11 and 10/14/11, and both were sold on 8/20/13 for 68.7% and 67.8% losses, respectively. Currently those have widened to 71.2% and 70.4% losses. This was sold because of declining sales and a worsening balance sheet, and I believe that still holds true today. While I believe that Provenge could do very well, Dendreon has not done well with it, and I was slow to recognize that.

Lesson: Don't get blinded by the potential; pay attention to the business.

Of the four closed positions, I think the Oshkosh decision was the only one where I made a mistake in selling. (NamTai was, for me, a mistake in buying and Dendreon was a mistake in not selling earlier.) I had confidence that the world recession would reverse (and it did), but I let fear and impatience overwhelm me on that one. For the other three, I believe I made the right decisions.

The reason to track the sells you make is to improve that part of the process of portfolio management, often called the most difficult part. By analyzing what's happened since each sell decision, you can reinforce things you know, take the blinders off, and learn how you fall prey to emotions. This exercise has helped me improve my overall investing process. I hope you use it to improve your own.