Most investors are too focused on day-to-day events that drive the market in the short term, whether it’s quarterly earnings reports, political pronouncements or unemployment statistics. ­Better: Investors should also look ahead over the next several years to the kinds of growing trends that are likely to propel industries over the long term. 

Here are some of the most powerful trends that could dominate the stock market in the 2020s and the 10 best stocks to take advantage of them…

Trend: Hundreds of prestigious colleges will offer degrees entirely online. A few dozen, including Harvard, Yale, Georgetown and UC Berkeley, already let you earn a master’s degree by taking online classes. As more students who have grown up with the Internet seek less expensive alternatives to on-campus education, the undergraduate and graduate online-learning market is likely to grow about 7% annually and reach $325 billion by 2025. My favorite stock now…

2U (TWOU) has carved out a niche as the leading online software platform for higher education. The company has established online graduate degree programs for more than two dozen leading universities (including the ones listed earlier). Recent share price: $68.70.

Trend: Businesses around the world will turn personal data into gold mines. Only recently has powerful software technology emerged that allows any business—no matter what size—to scrutinize the mountains of daily data it collects on customers. That enables the businesses to gather insights that can save them money or suggest new ways to profit. The global market for analytic software that sorts through all this raw data is growing 30% a year and will be a $40 billion market by 2023. My favorite stocks now…

Splunk (SPLK) provides more than 15,000 companies including Coca-Cola, Hyatt and Nasdaq with analytic software to spot trends, anomalies and cyber-security threats in their own data and systems. Recent share price: $132.42.

Guidewire Software (GWRE) sells core systems, analytics and digital-marketing software and services to property and casualty insurers in 30 countries. Such a narrow focus might seem like a drawback, but Guidewire has a near monopoly on a sector of the insurance industry that needs to update its antiquated technology and that will grow steadily for decades. Recent share price: $91.04.

Trend: At least two million self-driving vehicles will hit the road by the middle of the next decade, mostly with ride-hailing services. The proliferation of these vehicles is inevitable because they will have a dramatic impact on improving safety and reducing congestion. Prototypes now are being tested by nearly 50 major automakers and technology companies. Some are likely to start selling self-­driving models in 2020, and the market is expected to grow to $65 billion globally by 2027. My favorite stock now…

Aquantia (AQ) makes ultrahigh-speed semiconductor chips for the auto industry. The chips allow the thousands of bits of data from sensors, cameras and ­radar systems in vehicles to be ­continuously collected and analyzed in milliseconds to safely maneuver vehicles. Because Aquantia is a supplier to a large share of the industry, it’s a less risky bet than investing in any particular car manufacturer. Recent share price: $8.56.

Trend: One-third of all US corporate bonds will be traded electronically. That will allow investors to buy and sell bonds cheaply and efficiently like stocks. Remarkably, most trading in the $40 trillion US bond market still is done over the phone. New electronic marketplaces will allow investors to trade more quickly, find the best prices and minimize transaction costs. My ­favorite stock now…

MarketAxess Holdings (MKTX) is the dominant bond e-trading platform in the US. It controls 85% of the daily volume of US corporate bonds that have started to trade electronically in the US, about $4.4 billion worth. Recent share price: $235.16.

Trend: More than 75 billion “smart” products will send and receive data via the Internet by the end of the next decade. That’s up from about 20 billion today. Competition among smart-product manufacturers and suppliers will be fierce, making it difficult for investors to pick winners. But there is a completely overlooked area. It is focused on the needs of engineering firms and manufacturers’ research divisions that create new smart products in which tiny electronic parts, mechanical systems and communication technology all must work together seamlessly. My favorite stock now…

Ansys (ANSS) is a global leader in simulation-design software, allowing engineers to test multiple concepts when designing products, reducing the need for physical prototypes and resulting in faster, shorter development time. Recent share price: $174.49. 

Trend: Hundreds of new data centers will be needed to physically store, maintain and interconnect the “cloud.” These warehouses, equipped with state-of-the-art computer servers, networking gear and security, are needed to handle the ever-increasing amount of data we upload to the Internet. The global data center market is likely to grow 13% annually and reach $12 billion by 2023. My favorite stock now…

Equinix (EQIX) is one of the world’s largest data-center operators, with more than 200 properties in 24 countries and nearly 10,000 clients locked into recurring contracts, including the mega cloud vendors ­Amazon.com, Google and Microsoft. Recent share price: $425.86.

Trend: Scores of deadly cancers will become survivable, even manageable, with the help of sophisticated DNA analysis. The analysis is used to screen for diseases and identify the best treatment options. The market for genome-sequencing equipment that is used to analyze the structure of DNA is likely to grow 19% a year and reach $25 billion in 2025. In addition, the market for diagnostic tests for detection of cancer and other diseases should grow 12% annually and reach $22 billion by 2024. My favorite stocks now…

Guardant Health (GH) makes “liquid biopsy” kits for hospitals and ­oncologists that test for dozens of types of cancer. The kits are sophisticated blood tests that detect DNA fragments shed by cancerous tumors. Recent share price: $52.91.

Illumina (ILMN) controls about 70% of the world market for high-tech tools and equipment that are essential for gene sequencing. Recent share price: $296.88. 

Trend: Two-thirds of all money spent on advertising will be spent online. This year, for the first time, more money will be spent on digital ­advertising—$129 billion—than on the total combination of television, print and radio ad spending, according to the eMarketer research firm. Online ad spending in the US is projected to represent two-thirds of all ad spending by 2023. My favorite stock now…

The Trade Desk (TTD) makes software that helps ad agencies and companies buy and optimize advertising for desktop and mobile devices. It’s one of the few US technology companies that has had success bringing foreign advertising to online shoppers in China. Recent share price: $150.49.