All investors make mistakes from time to time, and I'm no exception. In my case, I consider my biggest investing mistake to be selling excellent stocks too early simply because they had gone up in price.

Here's a quick story about one stock I definitely unloaded far too soon, how I learned from the mistake, and how you can avoid making similar errors.

Green sell button on a keyboard.

Image source: Getty Images.

My best and worst investment of all time

One of the questions I get asked most often is "What is the best investment you've ever made?" Well, my answer has changed slightly in recent times (more on that in a bit), but for a long while it was an easy response. In 2011, I bought shares of Tesla (NASDAQ:TSLA) for about $23. If you look at Tesla's stock price history since then, it's easy to see why I consider this a particularly good call.

TSLA Chart

TSLA data by YCharts

The natural follow-up question I often get is "OK, so what was your worst investment ever?"

The answer always catches people by surprise -- Tesla. Or, more specifically, selling Tesla when I did, and why I did, is what I consider to be my worst investment move ever.

Not long after I had bought my shares, in late 2012, Tesla's soon-to-be-released Model S sedan was unexpectedly named Motor Trend's "Car of the Year," and shares took off. When the stock had reached approximately $58 in mid-2013, I decided I'd better lock in my profits and get out.

Now, I had more than doubled my investment in a little over a year, and for a while that was my best-performing investment ever, which is why it was my answer for "best investment ever." On the other hand, I left tons of gains on the table, as Tesla trades for about $375 per share as I write this. Pulling the trigger and selling too early cost me more than $300 per share on a rather large investment by my standards.

I've had a few other instances of selling stocks too early over the years, but my Tesla investment stings the most. If I still owned my shares, I'd have made enough additional profit to literally buy a Model S.

The lesson I learned: Price is just a number. Look beyond it.

Sure, there are some good reasons to sell stocks. Mine just wasn't one of them.

Good reasons to sell include when something fundamentally changes and your original reasons for buying the stock no longer apply. For example, if you buy a stock because you think it'll grow at a certain rate, and growth unexpectedly slows, it can be a good idea to sell. If company executives suddenly start heading for the exits, it can also be a good reason to sell.

The point is that there are a bunch of situations when it can make perfect sense to sell a stock. However, "the price went up" in and of itself is a terrible reason. What if you had sold Apple when it rose from a split-adjusted price of about $1 in 2004 to $15 in mid-2007? It's over $200 today. Or what if you had sold Netflix when it rose from about $3 in 2007 to $9 in early 2010 simply because you tripled your money? If you'd held on, you'd own shares that are trading at more than $350 currently. 

How I learned from this mistake

All investors make mistakes. The difference between good and bad investors is how they learn from them.

In my case, selling Tesla way too early and missing out on nearly a hundred thousand dollars in gains has helped me make smart investing decisions with some of my biggest winners. Just to name a couple:

  • I bought shares of Bank of America (NYSE: BAC) for about $11 per share in early 2016 and held on to the stock even after it doubled by the end of the year. I loved how the business was transforming, so I held on. I still hold Bank of America in my portfolio, and the stock now trades for more than $31.
  • After noticing that more and more vendors at my local artisan market were accepting credit cards with small card readers attached to iPads, I decided to buy shares of recently public Square (NYSE: SQ) for about $10 in early 2016. To be fair, I was certainly tempted to sell when the stock climbed to about $30 as the company's growth accelerated in 2017, but because of my Tesla experience, I held on. Now Square is worth more than $70 per share and is officially my best-performing investment ever. Thanks to Square, I no longer have to call my Tesla mistake my all-time biggest winner.

The bottom line is that I took one of my biggest investing mistakes of all time and turned it into one of the most valuable lessons I ever learned. There are two key takeaways here.

First, don't be afraid of making mistakes like this one. Obviously, try to get things right the first time, but know that all investors make mistakes. It's important to learn from them and move forward.

Second, you can avoid repeating my mistake by pausing and asking yourself "why am I selling?" before unloading your biggest winners. If you don't have a valid reason for selling, you may want to think twice.

Matthew Frankel owns shares of Apple, Bank of America, and Square. The Motley Fool owns shares of and recommends Apple, Netflix, Square, and Tesla. The Motley Fool has the following options: long January 2020 $150 calls on Apple, short January 2020 $155 calls on Apple, short September 2018 $80 calls on Square, and long September 2018 $55 puts on Square. The Motley Fool has a disclosure policy.