The S&P 500 (SNPINDEX: ^GSPC) index is one percentage point from a new record high, and it's also a percentage point from a new bull market, according to the most conservative definition. That threshold portends substantial gains. The S&P 500 returned a median of 223% during the last five bull markets, according to Vanguard.

Investors that want to benefit from that upward momentum should be buying stocks today, and Shopify (SHOP -0.92%) and The Trade Desk (TTD -1.90%) are primed to create value for patient shareholders. Both companies have promising growth prospects, and both stocks are priced below $100, making them widely accessible.

Here's what investors should know.

1. Shopify

Shopify provides software and services that help merchants manage their businesses across brick-and-mortar and digital storefronts. Its platform connects with e-commerce marketplaces like Amazon and social media like TikTok, and it supports branded websites and mobile apps. Shopify also provides ancillary financial solutions and logistics support, as well as tools for cross-border and wholesale commerce.

That turnkey approach first made Shopify popular with small businesses, but the company is moving upmarket with help from its enterprise platform Shopify Plus. Consultancy Gartner recently named Shopify a leader among digital commerce platforms, citing its robust portfolio and rapid innovation as key strengths. Similarly, research company G2 recently recognized Shopify's leadership in e-commerce software and omnichannel commerce software.

Shopify had a good third quarter. Revenue increased 25% to $1.7 billion on momentum with larger merchants, traction in international markets, and pricing power. Additionally, the company reported net income based on generally accepted accounting principles (GAAP) of $718 million, up from a loss of $159 million in the year-ago period. That improved profitability reflects the sale of its cost-intensive logistics business to Flexport, which now serves as its preferred logistics partner.

In other news, Shopify placed No. 16 among the Fortune Future 50 List for 2023, an annual ranking of the world's largest companies based on their long-term growth prospects. One reason for that commendation is Shopify Magic, a suite of artificial intelligence tools that help merchants build storefronts, market their products, and make data-driven business decisions.

Shopify has innovated quickly in the past. Investors should be pleased to see the company moving to capture demand for automation. With that in mind, retail e-commerce sales are forecast to increase at 8% annually through 2030, and wholesale e-commerce sales are projected to increase at 20% annually during the same period. To that end, Shopify should manage sales growth in the high teens through the end of the decade.

In that context, its current valuation of about 15.7 times sales appears fairly reasonable, especially when its three-year average is 23.5 times sales. Patient investors -- those willing to hold their shares for at least five years -- should feel comfortable buying a position in Shopify today.

2. The Trade Desk

The Trade Desk is the largest independent demand-side platform (DSP) in the ad tech industry. Its software leans on artificial intelligence (AI) to help media buyers plan, measure, and optimize data-driven ad campaigns across digital channels like desktop, mobile, and connected TV (CTV).

The Trade Desk's independence -- it doesn't own media content that could bias ad spending -- has attracted a number of retail data partners, creating measurement capabilities not available on other ad tech platforms. In fact, CEO Jeff Green says The Trade Desk provides access to "the world's most advanced data marketplace."

Additionally, Green believes that unique data gives its ad tech platform superior AI capabilities, allowing advertisers to measure and optimize campaigns more effectively than with other platforms. In keeping with that point of view, consultancy Quadrant Knowledge Solutions recently recognized The Trade Desk as the best ad tech platform on the market, scoring the company above peers in both "technology excellence" and "customer impact."

The Trade Desk reported good financial results in the third quarter, once again outpacing market leader Alphabet. Specifically, revenue increased 25% to $493 million, growing nearly three times faster than Alphabet's ad revenue, and non-GAAP net income rose 29% to $167 million.

During the quarter, The Trade Desk continued to gain share in CTV advertising and retail media, the two fastest-growing verticals in the digital advertising market. The company is primed to maintain that momentum given its (1) position as the leading DSP for CTV advertising and (2) partnerships with retailers like Walmart and Target.

Looking ahead, the ad tech market is forecast to expand at 14% annually through 2030, but investors can look for The Trade Desk to outpace the market and continue gaining share. Indeed, analysts at Morningstar are projecting sales growth of 22% annually across the next five years.

That sensible projection makes its current valuation of about 18.8 times sales seem fair, especially when its three-year average is 27 times sales. Patient investors should feel comfortable buying a small position in this growth stock ahead of the next bull market.