Vertex Pharmaceuticals (VRTX 0.51%) has been through some ups and downs over the past few years. The big biotech disappointed investors when a couple of candidates outside of its specialty area of cystic fibrosis (CF) failed along the development path. But the company continued to impress with its CF products and their revenue growth as well as its advancement of other non-CF candidates in the pipeline.

If you'd invested $10,000 in Vertex five years ago, you would have accompanied the company on some of these ups and downs. How much would you have today? Let's find out.

Two people look at something on a phone on a city street.

Image source: Getty Images.

Beating the S&P 500

Considering Vertex shares have gained 118% over the past five years, beating the S&P 500's 73% increase, the value of a $10,000 investment five years ago would total $21,800 today. The idea of buying and holding on for the long term is key to those winnings, reinforcing the idea of choosing quality companies and sticking with them for a number of years. If you had lost patience with Vertex during some of the down points, you could have walked away with a much smaller gain -- or no gain at all.

Now, moving forward, there's reason to continue being optimistic about this biotech company's ability to deliver additional long-term rewards. Vertex recently won approval for Casgevy, a gene-editing treatment for blood disorders, showing it has what it takes to expand beyond CF. And the company is approaching the finish line with a candidate for pain as well as a new CF candidate that may even beat Vertex's current best seller. Vertex just launched a rolling regulatory submission for the pain candidate and aims to file for regulatory review of the CF one by the middle of this year.

All of this means now is a great time to hold onto your shares of Vertex, or even buy more for the reasonable valuation of 23x forward earnings estimates -- and bet on more long-term winnings from this hot biotech stock.