October doesn't have a great reputation when it comes to stock market performance. The Dow Jones index plunged nearly 23% in a single day on Oct. 19, 1987. Then there's the most infamous October of all in 1929 when a market meltdown at the beginning of the Great Depression.

While October has historically been relatively volatile for stocks, stocks often perform quite well during the month. For example, the S&P 500 index rose during the month of October in seven out of the last 10 years. Of course, we're just talking about how stocks have performed in just a month. Investors focused on the long term aren't concerned with these temporary fluctuations.

The bottom line is that October is as good of a time as any to invest in stocks that are well-positioned to succeed over the long run. Here are three stocks to buy this month that definitely fit the bill. 

Pumpkin full of $100 bills

Image source: Getty Images.

1. Fastly

What are some of the best characteristics of a winning stock? I'd put fast-rising revenue and a huge potential market near the top of the list. A relatively small market cap would also be a nice plus since it's easier for small companies to generate greater growth. Fastly (NYSE:FSLY) checks off all of these boxes.

Fastly's revenue soared 62% year over year in the second quarter. And the company's revenue growth is accelerating. This growth stems from the increased adoption of Fastly's content delivery networks (CDNs) and edge platform products. The COVID-19 pandemic has boosted internet usage, which in turn has fueled higher demand for Fastly's products.

Edge computing moves processing close to the point where organizations' networks connect with the cloud (known as the cloud's "edge"). CDNs distribute servers geographically so that content can be delivered more quickly over the internet. Together, these two technologies represent and addressable market estimated at more than $35 billion annually.

Fastly currently claims less than 1% of this potential market. Even though the stock has more than quadrupled over the last 12 months, the company's market cap stands at less than $11 billion. Fastly should be a massive winner over the next decade.

2. Facebook

It's easy to hop on the bandwagon of Facebook (NASDAQ:FB) naysayers. Some criticize the social media giant for its policies about political posts. Others think the company should be broken up because it has too much power. But Facebook is a great stock to buy right now, in my view.

For one thing, Facebook is relatively cheap. The stock is around 14% below its August highs. It's close to 10% below the average analysts' price target. Sure, Facebook's shares trade at nearly 25 times expected earnings. But its price-to-earnings-to-growth (PEG) ratio, which factors in growth expectations over the next five years, stands at a low 0.95. Any PEG ratio below 1.0 is usually seen as an attractive valuation.

Facebook delivered 11% year-over-year revenue growth in Q2, with its earnings nearly doubling. It managed to do this even as advertisers cut back on spending in the wake of the COVID-19 pandemic. As advertising spending bounces back, Facebook's growth should accelerate.

The bigger story for Facebook, though, is its long-term growth prospects. I'm especially excited about the company's opportunities in augmented reality (AR). Facebook is gearing up for a big AR push next year. I expect it will be a big winner in AR over the rest of the decade.

3. Vertex Pharmaceuticals 

You'll have a hard time finding a stronger biotech stock than Vertex Pharmaceuticals (NASDAQ:VRTX). The company's sales and profits are soaring. Wall Street analysts project 25% earnings growth over the next five years. Vertex also has a big cash stockpile totaling $5.5 billion that it can use to buy back shares and bolster its pipeline. 

Vertex markets the only approved drugs that treat the underlying cause of rare genetic disease cystic fibrosis (CF). Its newest CF drug, Trikafta/Kaftrio, has generated nearly $1.4 billion in U.S. sales less than nine months after receiving FDA approval. The drug is now approved in Europe, presenting another big growth opportunity for Vertex.

While Vertex should enjoy a monopoly in CF for at least a few more years, the company hopes to expand its market in the not-too-distant future. Vertex's pipeline includes three programs in mid-stage clinical studies that target rare genetic diseases alpha-1 antitrypsin deficiency (AATD) and APOL1-mediated focal segmental glomerulosclerosis (FSGS). AATD affects more people in the U.S. than CF does worldwide.

It's still early, but I think Vertex should have a pretty good chance of replicating its success in CF in at least one of these other genetic diseases. The company could also have an even bigger game-changer waiting in the wings: Vertex plans to advance an experimental gene therapy into early stage testing next year that could potentially cure type 1 diabetes. 

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.