Investor optimism is high now that we're in a new bull market. Many dream of becoming millionaires on a single stock pick (which isn't likely).

Instead, setting up a sustainable investing strategy -- like investing a set amount monthly and picking a few stocks with strong potential to beat the market -- will provide you a better path to becoming a millionaire. By focusing on this process, you're more likely to stick with it through all types of market conditions.

But are there any good stocks to buy now with the market hitting new all-time highs? Despite all the optimism, I have three that still look like bargains.

1. Amazon

Amazon (AMZN 3.43%) is most famous for e-commerce, but its business has dramatically transformed over the past five years. It has increasingly become an e-commerce service company, which is far more profitable than just being in the e-commerce game.

While its online stores are still the largest part of its business, other features like third-party seller services, subscription services, advertising services, and cloud computing (Amazon Web Services) are large segments as well. Combined, they are larger than its online stores, with that segment bringing in $57.3 billion in third-quarter revenue while the others generated $79.6 billion in revenue.

As a result of this business focus and efficiency improvements, Amazon's margins have reached sustainable all-time high levels.

AMZN Gross Profit Margin (Quarterly) Chart

AMZN gross profit margin (quarterly), data by YCharts.

If Amazon can continue increasing its margins and growing at a strong pace, its earnings growth will propel the stock higher and crush the market. Investors haven't seen what a sustainably profitable Amazon looks like, but 2024 will likely be the first glimpse, and I want to own a piece of it.

2. MercadoLibre

MercadoLibre (MELI 3.09%) has often been described as the "Amazon of Latin America," with an e-commerce storefront as well as a logistics division to deliver packages. But MercadoLibre has another key product that Amazon doesn't: a fintech service.

The commerce division's revenue rose a currency-neutral 76% year over year to $2.1 billion, and its fintech division is also doing well, with revenue rising a currency-neutral 61% to $1.6 billion. This level of growth is nearly unmatched in the market and makes MercadoLibre a strong choice.

Its margins are rapidly expanding (its operating margin increased 7.2 percentage points to 18.2% in the third quarter), and the stock looks like a no-brainer buy if bought at the right price.

MELI PS Ratio Chart

MELI PS ratio data by YCharts. PS = price to sales.

And the stock continues to trade below a decade-long average valuation, making it still look like a bargain. With its growth and reasonable price, MercadoLibre could be a great buy right now.

3. dLocal

Reaching countries in emerging markets is a goal for many businesses as they look to capture as large an audience as possible. But getting payment infrastructure set up in some locations is difficult since countries have different levels of digital-payment maturity and regulations to understand.

This can make selling in these countries unprofitable, but that's where dLocal (DLO 0.56%) comes in. It has already set up payment infrastructure in many emerging market countries (like India, Indonesia, Colombia, and Egypt), so companies like Amazon, Shopify, and Nike can easily sell in these countries.

This business model has been a win for dLocal, and its financials back it up. Third-quarter revenue rose 47% to $164 million, with total processed volume increasing by 69% to $4.6 billion. The company also generated $40.4 million in profits in the third quarter.

With a great business model, strong growth, and solid profitability, you would think dLocal would be a more popular stock. But it has flown under the radar, which allows you to get in before it's more widely known.

DLO PE Ratio (Forward) Chart

DLO PE ratio (forward) data by YCharts. PE = price to earnings.

At just 22 times forward earnings, dLocal is a steal at these prices and a great way to accelerate your journey to becoming a millionaire.