Investors who base their strategy on fundamentals operate in a very different manner than quantitative analysis based traders. Quantitative traders who base their strategy on technical analysis are able to scan thousands of charts per minute equipped with a bevy of indicators, ratios and data points finding the right instrument to suit their algorithmic trading strategy. Fundamental analysis, on the other hand, is different. Fundamentals don’t change per minute the way prices change. Balance sheets, PnL statements, inventory, cash flow these things are made available at max once in a quarter.
Considering that, is there a way to analyze fundamentals the way quants analyze price-volume movements? Can you automate this process and maybe create an algorithmic trading strategy out of it? Well, this blog will help you do exactly that.
What goes into an algorithmic trading strategy? It’s simple, there is, of course, the data, the strategy (algorithm) and the broker’s API which will allow you to execute trades as per the strategy.
Now let’s dig deep into each of these sections.
This is the most crucial part of the equation. Where do you get fundamentals data of a company that is uniform, structured, accurate and most importantly in a format that a machine (algorithm) can understand?
Here is a list of reputable fundamentals data sources that are known for their data accuracy, variety and availability of a large number of trading instruments.
|Data source||Markets covered||Data points provided||Pricing||Data format||More info|
|Quandl||Predominantly US and Canadian securities. And select securities from global (~67 countries) markets are available||90 – 200 data points available US & Canadian securities. 59 for global indicators||Starts at $49/user pm, can go as high as $1000/user pm||CSV, JSON, XML||click here|
|Bloomberg||Access to 35 million instruments across all asset classes, aggregated from 330+ exchanges||Key fundamentals data, Insights, research reports etc.||$1500 – $3000 a month||CSV, JSON, XML||click here|
|SEC.gov (EDGAR)||US securities includes 12000+ companies||All sorts of corporate forms (10Q, 10K, 8K, S1, F6 etc.)||Free access for manual data access. Paid (approx. $1200 /year) for use through third party API for algo trading||XML, HTML, JSON||click here|
|MorningStar||26000+ companies worldwide||Key fundamentals data, Insights, research reports etc.||Custom pricing, you’ll have to get in touch with them||Through API and XMLs||click here|
Additionally, you can also look at below data sources, just in case:
Precautions to be taken:
Since the nature of the fundamentals data is different than your usual price data. There are many possibilities where your trading strategy can end up taking wrong decisions based on not so correct data.
For example, some companies may lie in their reports, and there are multiple reasons as to why they would do this, but the most prominent is just to make them look good. Here are some such examples,
- If the company includes receivables in the earnings reported. The money hasn’t come into their accounts yet but the company thinks the money will surely come at some point. But this could be a huge blunder for a fundamentals trader
- Sometimes companies showcase sales numbers that are obtained by selling the product to their own related companies
- Reports may not show any tax component for first three quarters but have a big one in the last quarter
Things like these come out in audits and the auditors make companies fix these issues, but the problem is important audits are conducted on yearly basis and you may have already taken a trade decision based on the pre-audited data.
So how do we avoid these things? You can by sticking to some ground rules:
- Only consider companies that have a history of disclosing data accurately
- Include qualitative filters for small or unreliable stocks
- Make sure the back-testing period is long enough
- Be aware of forward-risks while conducting back testing, meaning things that might happen in future which could affect a stock’s performance are not usually present in balance sheet
Trading strategy example based on fundamentals
Now let’s dive into an actual trading strategy that is based on fundamental data. We have taken Quantopian’s help in this.
Quantopian has tied up with Morningstar for fundamentals data, there are more than 600 metrics you can make use of in your trading strategy. You can get more data here on the fundamentals provided by Quantopian.
Peter Poon, a dedicated quant on Quantopian has developed a strategy algorithm on fundamentals, he calls it “A quantitative value investing strategy using fundamental data”.
Here’s what the strategy is all about.
- Select no more than 15 stocks that satisfy the following rules: P/E < 12, P/B < 2, ROE > 15%, market cap > $100M
- Hold the selections for one year, and re-do the selection next year
You can find the details of the strategy here.
Here is the source code for this strategy, you can go through ~200 lines of code and try to decipher what Peter is trying to do or you can just sign up for our ‘Python for Trading’ course that will teach (actually hand-hold you) to code your own trading strategy.
Here’s how the strategy performed during the backtest:
Performance in numbers:
Peter thinks the strategy results are in good agreement with the traditional value investing. The selected stocks in this trading strategy outperformed the market by almost twice.
However, backtesting results are on paper, there are multiple factors (more in number than quantitative trading) that affect fundamentals of a company and its performance. Developing a strategy that includes all of them is a mammoth task.
Having said that, the markets are already moving towards algorithmic trading and slowly all sorts of data is being made available in machine readable format. For example, news, social media and economic events based feeds are prevalent today.
Incorporating fundamentals into an algorithm trading strategy and letting it do the heavy lifting is the way forward. This approach presents a new dimension of possibilities that were not accessible to tradition fundamentals trader. Take your first step towards learning algorithmic trading via our self-learning portal Quantra and our comprehensive virtual classroom based course Executive Programme in Algorithmic Trading (EPAT™).