November 27, 2020
Quantitative finance is an inherently secretive field where people who become profitable never reveal their secret formulas of success. However, this has started to change in recent years thanks to the likes of Marcos Lopez de Prado, Ernest Chan, and others. Although algorithmic trading remains a difficult problem to solve, the knowledge that these people have given to the public is invaluable. At Tradytics, we are continuously reading the latest research and trying new ideas to create profitable trading algorithms. Today, we are going to talk about one such AI system that has resulted in us beating the market by 20% in the last 1 month. Although this time period is very short, we want to give others a taste of how things work at Tradytics and how we go about solving different problems. We are also going to continue creating automated systems with an intent to consistently beat the market. Let us now talk about how we created 5 AI driven portfolios that each gained over 30% returns in the last 30 days.
Let's start with a basic idea of what we do before diving into the details.
We generate millions of random portfolios, optimize their allocation using existing and proprietary portfolio optimization algorithms, and rank them using our AI engine.
There has been thousands of papers on portfolio optimization in the last three decades. Starting with markowitz portfolio optimization theory to the more recent reinforcement learning based optimization methods, there are countless research papers to read and implement. However, as is the case with the majority of proposed methods in literature, the portfolios are created based on historical returns. If there is one thing we know about the stock market, it's that historical returns are not always representatives of future returns. This is a major problem that one needs to solve in order to create effective portfolios. As market regimes change, algorithms that were based on historical data suddenly become ineffective. Therefore, we need a way to combine the literature with a novel mechanism of adding some predictive power to our portfolio optimization strategies.
At Tradytics, we use 3 strategies from literature and two proprietary ones based on genetic algorithms. These strategies are:
MVP, MSR, Eigen, and GA based portfolio optimizations have been studied in the literature in depth and many trading firms still use them. This is where we start as well but we add something important on top to make these strategies work well. As we said in the start of this section, our basic idea is to generate millions of random portfolios and rank them using our custom AI algorithms. The ranking system is where our novelty comes in. The following image visually explains our portfolio selection process.
After generating millions of portfolios and optimizing their weights with the aforementioned strategies, we use our proprietary ranking system that ranks all these portfolios in terms of their future predicted returns. We keep the best portfolio for each of the five strategies which goes to our website at Tradytics AI Portfolios. Let us now dive a bit deep into the portfolio generation and selection process.
The image below shows 25 random portfolios from a collection of millions of portfolios we generated on October 31st. We start with selecting 5 random stocks for every portfolio and optimize the portfolio on 1 year of historical data up till October 23rd. After optimization, we backtest the portfolios to look at their historical returns. Since optimization is being done on historical data, the backtested returns are expected to be high which is what we can see in the image below. However, there is a huge problem here. Our optimization procedure only looks at historical data and has no inherent predictive power. It implicitly makes an assumption that historical returns are predictive of future returns. This is not always true and solely relying on this assumption can lead to huge losses. We can see this if we forward test our 25 portfolios from October 23rd to October 31st, 2020. Although profitable on historical data, the portfolios are all at loss when ran live - some are down 20% in a week. This illustrates the problem at hand with portfolio optimization methods. Let us try to solve it.
At Tradytics, we go one step further from portfolio optimization. Once we get these millions of optimized portfolios, we use our proprietary AI ranking algorithm to rank them based on what the AI thinks will be their future returns. The ranking procedure is basically a predictive model that predicts the returns of portfolios based on their allocation by the optimization method, their spreads with each other, and their historical returns. Once the ranking is done, we simply pick the best portfolio from each of the five strategies noted above, thus giving us 5 portfolios every month. Our main goal with these portfolios is to generate large returns and consistently beat the market. In order to preserve our alpha, we will not give any technical details away regarding our ranking system.
The first set of portfolios we generated was on October 31st. Our top 5 portfolios had the following allocations and stocks in them. The green weights indicate longing the stock while the red weights suggest shorting.
At the time of creating these portfolios, the weights did not make much sense by simply looking at each individual stock. However, since the ranking engine has been trained on a large amount of data and has high predictive power, it extracted certain patterns that made it confident that these portfolios would end up being profitable. Let us take a look at the returns of each individual stock as well as the entire portfolio.
When looking at the backtest results of the top portfolios, it is easy to see that the historical returns are quite volatile would yield a low sharpe ratio. However, since history is not always the future and our ranking engine is tasked to predict the future returns, these portfolios were selected because of high AI confidence in larger returns.
When these 5 portfolios were run live for the month of November, these yielded very high returns as compared to the market. The $SPY index gained about 10% in the month of November. The following image shows the gains of each of our portfolios.
The results are quite impressive. All portfolios have garnered gains of above 30% in just 30 days with some of them touching about 40% cumulative returns. Now, we admit that there is a bias in the results here because of the strong bull market in the month of November. However, when the AI was ranking these portfolios, the bull market was not very strong - $SPY was down 2% in October. It was the ranking engine that was able to find predictive patterns in the portfolios which would eventually result in large profits. This demonstrates the effectiveness of using machine learning and artificial intelligence in portfolio selection.
Tradytics is a fairly new company in the quantitative finance game. We realize that these are short term results and we need to show consistency before we can make any claims about the AI capabilities of our toolkits. Our plan is to keep adding these portfolios every month and record the performance for atleast one year. The hope here is to consistently beat the market with significantly high returns. We will keep you updated. If you have any questions, please do not hesitate to reach out to us at our Discord.