If you're focused only on the short term, the stock market might look pretty scary right now. Stock valuations are frothy. COVID-19 doesn't appear to be going away anytime soon. U.S. job numbers aren't encouraging. 

But if you have a long-term perspective, it's a different story altogether. There are plenty of stocks that should perform well over the next five years or more. If you're a long-term investor with $5,000 or so to invest, here are three brilliant stocks to buy right now.

Man looking up at chalkboard drawing of light bulbs with the light bulb in the center colored yellow with a dollar sign in it

Image source: Getty Images.

Alteryx

Everywhere you look, data is being created in droves. This data is useless without being analyzed. The problem is that data analysis usually isn't an easy task. It often requires lots of manual processing in spreadsheets and pulling data from multiple sources. Programmers sometimes must be pulled in to help out. But Alteryx (AYX) makes the critical function of data analysis a lot simpler and faster.

The company likes to say that it democratizes data. That's a pretty good take on what Alteryx does. Its software sucks in data from pretty much any source. Alteryx automates analytical processes. No spreadsheets are needed. No programming required. 

This data democratization has proven to be very popular. Alteryx's customer base now includes over 6,400 customers with more than 37% of the Global 2000. The company especially targets large companies because they tend to have the most data to analyze and the biggest challenges.

Sure, Alteryx's valuation might seem terrifying with shares trading at nearly 25 times sales. However, the company continues to capture increasingly more of a $49 billion addressable market. Despite sizzling growth, its market cap still stands at around $10.5 billion. I think Alteryx will deliver huge returns over the next five years or more.

Guardant Health

A cure for cancer is probably a long way off. But many lives can still be saved in the meantime. How? By diagnosing cancer early. By developing more effective therapies. By prescribing the most optimal therapy for individual patients. Guardant Health (GH -5.19%) is busy making all of these things happen with its liquid biopsy products.

Liquid biopsies are tests that detect fragments of DNA in the blood that break off from cancer cells. Guardant Health currently markets two liquid biopsy products for which sales are skyrocketing. Guardant360 helps physicians select the best therapy to prescribe for patients with advanced-stage cancer. GuardantOMNI helps drugmakers screen patients for clinical trials of experimental cancer therapies.

While both of these products are rising stars, I'm even more excited about Guardant Health's Lunar liquid biopsies. The company reported encouraging results in June from a study of its Lunar-2 blood test in detecting early stage colon cancer. Guardant is also evaluating another liquid biopsy, Lunar-1, in clinical trials as a guide for adjuvant treatment decisions for colon cancer. Lunar-1 also has potential in cancer recurrence monitoring.

Guardant Health is even more pricey than Alteryx, with its shares trading at 30 times sales. However, I think buying the healthcare stock now will look like an incredibly smart move in hindsight within the next few years. The potential market for Guardant's currently marketed products is around $6 billion. If its Lunar tests are successful, the company will go after an addressable market topping $45 billion. 

Square

Cash is going the way of the dodo bird and the eight-track tape. This trend impacts businesses of all sizes as well as individuals. Square (SQ -1.68%) stands out as one of the companies best-positioned to profit from the decline of cash and rise of digital payments.

Many people know Square only for its small credit card readers used by many small businesses. However, the company offers a lot of other products and services to businesses, including payroll software and an e-commerce platform. Square now claims a full-blown ecosystem that proves to be very "sticky" for merchants. It has also expanded its sights to larger businesses.

But Square's fastest-growing opportunity lies with its Cash App peer-to-peer payment application. MoffettNathanson analyst Lisa Ellis thinks that Cash App could be worth more than the rest of Square's businesses combined. Even if she's overly optimistic, there's no question that Square continues to have many ways to monetize Cash App to fuel more growth for a long time to come.

The company's growth prospects make Square's sky-high forward price-to-earnings ratio of 270 a little easier to handle. Square stock could be volatile during the rest of 2020 if the COVID-19 pandemic worsens. Over the long run, though, this stock -- like Alteryx and Guardant Health -- looks like a brilliant choice for investors.