Jumping in and out of stocks is a sure way to lose money, not make it. It's why the investing legends have always been buy-and-hold types. Thinking about stocks you can own for decades, not till the next earnings report, will likely do more for your portfolio returns than anything else.

With that kind of mind-set, see why these three Motley Fool contributors believe TechTarget (NASDAQ:TTGT), Royal Dutch Shell (NYSE:RDS-A)(NYSE:RDS-B), and Home Depot (NYSE:HD) are stocks you will want to own for 20 years or more.

Plants growing out of progressively higher stacks of gold coins.

Image source: Getty Images.

You don't know this future tech titan... yet

Anders Bylund (TechTarget): Two decades from now, the world will be a different place. Let me put this time scale into perspective. Only 18 of today's Dow Jones Industrials components have stuck around for 20 years or more. So you can't just throw a dart at the Dow and expect the ticker you hit to remain a giant of industry in the year 2039. If historical precedent is any guide, you'd be wrong roughly 40% of the time.

The titans of tomorrow's industry might not be on your radar today. That's why I'm giving you a name that might not be terribly familiar -- yet. My analysis shows that tiny TechTarget should have staying power for miles, rewarding investors one way or another in the long run.

The company stands at the intersection of two market trends for the long haul. TechTarget uses cloud computing tools and artificial intelligence to help other businesses design and execute effective e-commerce sales and marketing campaigns.

TechTarget is already profitable and its balance sheet holds more cash than debts. Launching from that rock-solid financial platform, TechTarget's sales force is pursuing a mixture of small businesses and giant enterprises. Among more than 1,200 clients, you'll find tech sector titans such as Cisco Systems and Hewlett Packard Enterprise heaping praise on TechTarget's brand awareness services and value-boosting strategies.

This story can end in two ways. TechTarget could continue on its current path over the long haul, growing its customer base and boosting its own reputation until we're looking at a mature household name. Or one of the larger technology companies on the market today could buy TechTarget, folding its products and services into its own online sales marketing platforms.

Either way, I'm sure we'll see TechTarget making a real impact on the business world in 2039, and its investors will enjoy the ride thanks to rising stock prices or a generous buyout premium. After all, the stock is trading at just 21 times forward earnings. It should be easy to deliver shareholder value from that affordable starting point.

Defying expectations

John Bromels (Royal Dutch Shell): You might think I'm crazy, recommending an oil and gas stock to hold for 20 years. Renewable energy, electric cars, and tough climate legislation are all conspiring against such an investment, right?

Well, they haven't managed to eliminate our global demand for oil and gas yet. In fact, Shell has recently posted stellar back-to-back quarters, in which it churned out record amounts of operational cash flow. In Q3 2018, when oil prices were high, the company's upstream oil segment was the powerhouse, and in Q4, when oil prices were down and gas prices high, it was the company's integrated gas segment that did the heavy lifting for the company.

That's one of the advantages of having Shell in your portfolio: Its huge size and diverse group of businesses within the energy sector mean that it's often able to succeed where smaller oil and gas companies fail. Shell has also been investing heavily in liquefied natural gas (LNG), which is a market it sees growing faster than oil over the next 20 years. Also, because LNG is primarily used for heating as opposed to transportation, it isn't as vulnerable to competition from alternative fuels. But just in case, Shell has also been investing heavily in green energy, too. It owns several wind farms as well as a 44% stake in solar developer Silicon Ranch, and recently bought electric vehicle charging station provider NewMotion. CEO Ben Van Beurden has been particularly good at reacting to whatever the market throws at him, and clearly has an eye on a future when petroleum makes up a smaller part of the overall global energy environment.

Add a best-in-class dividend yield and solid fundamentals to the mix and you have a long-term winner in Royal Dutch Shell. 

Still not making any more land

Rich Duprey (Home Depot): Although questions remain about how healthy the U.S. housing market is, it doesn't look as though it's in imminent danger of stalling or falling, with analysts expecting new home sales to rise 1% and prices to rise 3.4%. The Federal Reserve has also sounded hesitant about raising rates as aggressively as it had been, which bodes well for more stability in real estate.

With that backdrop, Home Depot looks like a good bet for the coming year, but more importantly, it appears to be an investment you can hold for 20 years or more. Despite the ups and downs in the marketplace, homeowners and homebuyers will continue to turn to the do-it-yourself warehouse, as will professional contractors.

The Big Orange retailer has widened the gap between itself and principal rival Lowe's, and through continued investments in its digital platforms as well as its stores, Home Depot is better than a steady-state stock. That has some believing it could even become an important dividend stock.

Home Depot has increased its payout to investors for nine consecutive years, and with earnings due out in the next week, it could make it 10 in a row, as well as maintain the hefty increases in the dividend that investors have come to enjoy.

Shares of the home improvement leader trade at a reasonable 20 times trailing earnings and 18 times this year's estimates, with the dividend currently yielding 2.1%. That makes it a fair level at which to buy, and in 20 years' time, investors will likely find they have constructed a winning portfolio with Home Depot as its foundation.