When looking at a stock that's soared over time, one question always comes to mind: Should I buy at the high? Or even near the high? Sure, the company's outlook might be great. But it's still a little scary to jump in at those levels. And it always feels good to get a bit of a bargain, right? That happens when a stock takes a dip, you buy it, and then -- as you expect because you know it's a good company -- it rises.

So, if you're going to wait for that moment, which stocks should you choose? Well, I've been looking at three stocks that have gained big this year. I would even buy them at today's level considering their future prospects. But if they retreat a bit, then they really offer a great buying opportunity. Let's check them out.

Two people smile while sitting on a couch and looking at a tablet.

Image source: Getty Images.

1. Moderna

Moderna (MRNA 3.28%) has been one of 2021's superstars. The biotech company's coronavirus vaccine generated billions of dollars in revenue and profit in its first full quarter on the market -- and continued to do so throughout the year. As a result, the shares are heading for an annual gain of about 170%.

Chart showing rise in Moderna's revenue, net income, and price in 2021.

MRNA Revenue (Quarterly) data by YCharts

Some worry Moderna's vaccine revenue won't continue to increase in the long term. But I'm not worried for two reasons. First, I expect vaccine (or booster) sales to remain high for quite some time. Experts predict the coronavirus won't pack up and leave once the pandemic is over. We'll still need protection. And that means a vaccine or booster.

The second reason to be optimistic about Moderna's revenue prospects is this: Moderna's programs extend beyond the coronavirus. The company has 37 programs in the pipeline. And it recently launched a pivotal trial for its cytomegalovirus vaccine candidate. If all goes well, this might be another blockbuster product.

Even at today's price, Moderna trades at only 17 times trailing-12-month earnings. So, if the stock takes a dip, you can really get a bargain.

2. Target

The pandemic was sort of a springboard for Target's (TGT -0.36%) revenue. The company benefited as customers flocked to it for the essentials -- and in many cases discovered the menu of contactless pickup and delivery options. In fact, last year Target increased its sales more than it did in the previous 11 years combined.

But things haven't slowed down for this retail giant. The company's revenue and profit continued to grow this year too. In the most recent earnings report, in-store and digital sales climbed. And all five of Target's main merchandise categories posted double-digit growth. Customers are still going for Target's pickup and delivery services too -- they advanced almost 60% in the quarter. Moving forward, Target has pledged to invest $4 billion annually in its business. This is to ensure efficiency in the fulfillment of orders, accelerate store openings and remodels, and support the supply chain.

Even considering Target's 34% gain this year, the shares aren't excessively expensive. They're trading at about 17 times trailing-12-month earnings. That's down from more than 25 earlier this year.

3. Home Depot

Profit and revenue have been on the rise for years at Home Depot (HD 0.86%). But the pandemic offered the world's biggest home improvement retailer a major boost. That's because people spent more time at home fixing up their surroundings. Last year, Home Depot reported more than $21 billion in sales growth to total $132 billion.

Chart showing rise in Home Depot's revenue and net income since 2014.

HD Revenue (Annual) data by YCharts

The gain wasn't just temporary. Sales topped $36 billion in the most recent quarter. Home Depot continues to benefit from various factors -- for example, people spending more time at home and a shift from city living to life in suburban areas. Home Depot is also gaining from investments in two popular areas that are likely to remain popular post-pandemic: Digital and pickup/delivery. In the most recent earnings report, Home Depot reported digital two-year sales growth of 95%.

Even more good news: An area that lagged during the worst of the pandemic is bouncing back. That's sales to larger professional customers. Back then, people hesitated to invite workers to their homes. But these days, pro sales growth has strengthened -- even surpassing growth of sales to individuals.

Home Depot shares have climbed more than 50% this year. And the stock is trading close to its highest for the year in relation to trailing-12-month earnings. I would buy Home Depot even at this level -- and I did recently. That's because I'll hold on for the long term. But if Home Depot takes a dip, I'd stock up on even more shares of this industry giant.