Sep 7, 2021

The Theory Behind Using AI For Long-Term Stock Analysis

Shanif Dhanani

Setting the scene

When we introduced Apteo back in March, we touched on some of the methods that we’re using to analyze stocks with AI. Since that introduction, we’ve developed and released our first product, Milton (currently in beta, available at, improved and added to our data sources, refined our core data science technologies, added team members, and closed in on our target customer segment.

When we released our first product, Milton, we also released a white paper that describes how our technology works at a high level. Since then, we’ve had a few folks ask us to expand on how it’s possible to forecast and analyze stocks over the long run, especially when stock prices alone don’t seem to be predictive of stock performance. This post will answer that question, and we’ll start by contextualizing the problem using a bit of investment theory.

What makes stocks move

Those of you that have formally studied finance have likely seen the term “random walk.” For those that aren’t students of finance, this term refers to Eugene Fama’s research (along with subsequent research) that states that stock prices evolve in a random manner and can’t be accurately predicted. This idea is closely related to the idea of efficient markets.

At Apteo, we tend to think that in the short-term, price action probably is somewhat of a random walk. That’s not to say that there aren’t any statistical deviations, price patterns, or technical analysis methodologies that can be useful to predict prices, just that shorter-term stock performance has a significant number of unpredictable drivers and that these are difficult to understand, gather data on, and model today.

But we do believe that in the long-run, a stock’s performance tends to reflect the health of its underlying company’s business, long-term prospects, and the health of the economy. If a company has a good business in a favorable economic environment, its value will increase and more people will want to buy its stock, which will cause the balance between supply and demand of that company’s stock to tilt in favor of demand, subsequently raising that company’s stock price.

But understanding what makes a company’s business “good” or “bad” can take a lot of work. There are a variety of considerations and variables that come into play, and figuring out which of those truly impact stock performance is a time-consuming, high-touch, and challenging activity.

Fundamental analysis

A common approach to stock investing relies on “fundamental analysis.” In this approach, stock analysts work to understand the key drivers and future prospects of a company’s business model, its management team and approach, its growth prospects, the theoretical value for its stock price, and a variety of other factors that relate to a company’s operations in the real world. The theory is that a deep understanding of a company’s business will allow investors to make an informed decision on whether to buy a company’s stock at a certain price.

This kind of research requires analysts to dive deep into a company’s operations and business. Though each investor has their own approach to performing this sort of analysis, there are some common trends among many of them, including:

  • Reading about the company’s business, its philosophies, its management, its products or services, and anything else that relates to a company
  • Using knowledge about the company’s business and the larger economy to quantitatively model how a company’s business will evolve in the future
  • Speaking with management to understand how they think about their business and organization
  • Speaking with a company’s customers to understand how they feel about that company’s products or services

How AI can help

With recent advances in artificial intelligence, it’s now possible to use this same data that humans use to train machines to understand how to objectively analyze stock performance.

Using a large amount of historical data, in conjunction with data about how stocks have performed in the past, along with some in-depth math, AI models can find patterns within data that are predictive of future stock performance. These models can continuously learn as they get more data, and they can also be made to learn more efficiently by modifying their internal structures (which affects how they process data). In essence, over time they can learn more and they can learn more efficiently.

Once these models have learned, they can make data-driven forecasts on future stock performance. Using these forecasts, it’s possible to come up with a variety of different tools and product features, like lists of stocks ranked by their expected future performance, expected future sector rotations and performance, and alerts on major changes in future expected performance.

AI can also help to understand how risky a stock may be in the future. Though a particular stock may be predicted to outperform its peers over a certain timeframe, it may be highly likely to experience lots of ups and downs during that period. Many investors consider these types of stocks to be risky and want to minimize their exposure to these types of investments. AI can help here as well — using a similar approach to what’s mentioned above, it’s possible to forecast how likely a stock is to have these large upward and downward moves and provide reports and analyses based on these forecasts.

Benefits of AI

In both cases, one of the key benefits of using these techniques is the ability to have a purely data-driven methodology to identify the most influential and predictive data points that are predictive of stock performance. This methodology avoids the biases that humans may have when analyzing stocks.

Another benefit of using AI is the ability for machines to get better as they handle more data. Unlike humans, who have to create mental shortcuts, AI models can actually get better at learning as they have see more data.

No panacea

Despite the benefits of using AI to analyze stocks, it’s important to understand that artificial intelligence is not an oracle and it won’t be right every time. Today’s AI works well to identify patterns that have worked in the historical datasets that it uses to learn. They identify the key variables that have the biggest impact to overall stock performance in the datasets that they’ve used. But if a particular stock behaves extremely differently, or if those key variables that drive stock performance change suddenly, then these AI models may have trouble accurately predicting performance, or they may need time to react to the changing landscape.

That’s why we believe AI can be an invaluable tool for stock analysis and investing, but it is just one tool in a larger toolbox of investing.

About the author
Shanif Dhanani
Co-Founder and CEO, Apteo