Many economists watch a metric called the yield curve to help them forecast coming recessions. Specifically, Treasury securities of differing lengths can be plotted on a chart to create what is known as a yield curve. The plotline generally rises based on time to maturity with Treasury bills' longer maturity dates typically having higher yields than those with shorter maturity dates. That makes sense. If you lock up your money for a longer period of time, you should expect greater compensation. But when that situation flip flops and shorter Treasuries have the higher yields, the yield curve is said to be "inverted."

On March 29, a closely watched portion of the yield curve was briefly inverted. For a few seconds, the 10-year U.S. Treasury note was paying a lower percentage yield than the two-year note. The situation quickly corrected itself, but some investors are still worried. When longer-term Treasuries are in higher demand (their falling yields show more investors want them) it's a sign of uncertainty about the future. A similar inversion occurred before the last eight recessions. The biggest difference was the time between the inversion and the start of the recession, ranging from eight months to two years.

As an investor, here's what you should know about inverted curves and stock performance.

An investor looks worried as he works at his desk, while financial charts are shown on computer screens in the background.

Image source: Getty Images.

Is it time to sell?

The first thing investors should do is take a deep breath. The yield curve is not a crystal ball. There was a false alarm in 1998, and the inversion in late 2019 could also be viewed as a false alarm. Yes, a recession did take place in early 2020, but there is no way the bond market could have predicted a global pandemic.

Even if a recession does take place in the near future, the yield curve cannot tell you when it will start or when it will end, or how the stock market will perform during that period of time. In other words, don't try to time the market. Instead, the best course of action is to continue investing on a regular basis. After all, despite weathering eight recessions since 1969, the S&P 500 has still generated an annualized return of 7.5% over that time period.

Building on that idea, Shopify (SHOP -0.72%) and The Trade Desk (TTD 1.55%) still look like smart investments right now despite the economic uncertainty. Here's why.

Shopify: E-commerce

Shopify is the retail operating system for over 2 million businesses around the world. Its software allows merchants to manage sales across multiple storefronts, including brick-and-mortar locations and digital shops on websites, online marketplaces, and social media. Shopify also provides value-added services like payment processing and discounted shipping, and the Shopify App Store offers 8,000 additional applications for things like marketing, payroll, and customer service. In short, Shopify is an end-to-end solution for commerce.

That value proposition has made it the most popular e-commerce software platform in the world, and it's also made Shopify the second-largest player in the U.S. e-commerce industry. The company captured a 10.3% market share in 2021, up from 8.6% in 2020. Only Amazon has more market share. Not surprisingly, Shopify delivered stellar financial results over the past year. Revenue surged 57% to $4.6 billion, and generally accepted accounting principles (GAAP) earnings hit $22.90 per diluted share, up nearly ninefold from $2.59 per diluted share in 2020.

Looking ahead, online retail spend will grow at 10.6% per year to reach $7.4 trillion by 2025, according to eMarketer. That tailwind should be a powerful growth driver for Shopify. Additionally, the company is building a fulfillment network across the U.S. that should further differentiate it from rivals and supercharge its competitive edge. In short, Shopify is a key player in a massive market; management is making smart moves; and no recession will change the long-term growth trajectory of the e-commerce industry. That's why this growth stock is a smart buy right now.

The Trade Desk: Digital advertising

The Trade Desk operates the largest independent demand-side platform (DSP) in the ad tech industry. Its software helps marketers purchase ad space programmatically, meaning the process is automated through real-time bidding, a more efficient alternative to the traditional process of manually negotiating prices with publishers.

Better yet, The Trade Desk leans on artificial intelligence (AI) to help marketers create and optimize targeted campaigns across a variety of digital channels, including desktop, mobile, and connected TV. Each campaign powered by its platform generates more data, making its predictive engine better at driving clicks and conversions. Additionally, as the largest independent DSP (meaning it doesn't own any content and therefore isn't biased toward any ad inventory), The Trade Desk's business model is better aligned with its clients' goals compared to bigger rivals like Alphabet's Google and Meta Platforms.

That competitive edge has been a powerful growth driver. Last year, The Trade Desk achieved its eighth consecutive year with a customer-retention rate above 95%, underscoring the stickiness of its platform and the power of its independent business model. In turn, revenue surged 43% to $1.2 billion and non-GAAP earnings rose 32% to $0.91 per diluted share. And the company is well-positioned to maintain or even accelerate that momentum.

In 2021, gross spend on The Trade Desk's platform rose 47% to $6.2 billion, a figure that accounts for just 1.3% of the $492 billion digital ad market. To capitalize on that opportunity, the company recently partnered with a few high-profile businesses across different advertising verticals. That includes Walmart (the world's leading retailer) in shopper marketing, Samsung (the world's leading TV maker) in CTV advertising, and Xiaomi (the world's second-largest smartphone maker) in mobile advertising. In short, The Trade Desk has a durable competitive edge; management is making smart moves; and no recession will change the long-term growth trajectory of the digital ad industry. That's why this stock looks like a smart buy.