Quarterly Algorithm Review: 06/03/2023 to 09/01/2023
Quarterly Performance Rankings
Base Algorithm: +3.37%
Overall Market: +2.98%
Long Term Portfolio: +2.31%
Variable Market Neutral: +1.93%
Variable Sector Neutral: +0.06%
Market Neutral: -0.99%
Sector Neutral: -2.42%
The algorithm generated 1.06% extra return, on top of the portfolio, during this quarter. Given some factors that worked against us this quarter (which I’ll go into later in this report), I’m pretty happy with this level of performance. These aren’t the same >7% results we saw in the previous quarter, but those were unlikely to be sustainable.
Part of this lack of sustainability is our different portfolio strategies this quarter. Our current portfolio has a similar goal to the one we used throughout last quarter: defensive, defensive, defensive - but with a few key differences in stock selection.
The sector allocations, while varied, are extremely similar. Part of the reason for the reduced performance is that, in our portfolios this quarter, the algorithm hasn’t identified as many major standout tickers. If we compare our returns by ticker from last quarter and this quarter, we’ll see a clear difference.
I apologize for the readability of the latter graph. With more than 100 tickers to plot, there’s not much I can do. But examining the shape, we can see that our biggest winners didn’t win by as much as they did last quarter.
Additionally our #1 ticker this quarter was a familiar one: NVDA! This comes in spite of the fact that NVDA was even in our portfolio for less than a third of the quarter (it was removed on June 26th). Near the top of our list of profitable tickers, we can see many other familiar names from last quarter: META at #2, AAPL at #8, both removed July 10th. These were all tickers that regularly received heavy allocations during the last quarter, but in our current portfolio, the algorithm hasn’t identified standout tickers like them nearly as consistently.
This, to me, is one of the reasons we aren’t seeing the same level of out-performance these days. Without major standouts, the algorithm’s performance will always end up closer to that of the portfolio as a whole. While we do see some high allocations - CVX got more than a 10% allocation this Friday - it’s not as much or as often. It’s not uncommon to see days where nothing breaks a 5% allocation from the algorithm.
I theorize that we can improve the results of our algorithm by increasing the chances of it finding standout stocks like these. To do so, I’d be interested in using a portfolio that matches the S&P 500’s sector distributions. Let’s, for a moment, compare our sector allocations to SPY’s.
We can see a few sectors we currently over-allocate into (Healthcare, Utilities, Consumer Defensive), and some we under-allocate into (Technology, Consumer Cyclical). This is a portfolio we’ve chosen due to our long-term macro outlook on the market; we are still expecting a recession. While we believe in every stock and every sector in our portfolio, this is inherently a bet on or against those sectors. It doesn’t matter how strong our fundamental models are: if the healthcare sector as a whole under-performs, we’re in trouble. Further, if tech stocks start doing very well, we won’t be able to keep up.
I’m interested in using a portfolio that matches the distribution of the S&P, but still consists of companies that our analysis suggests will do well in the long-term. We can use a portfolio that’s 28% technology, but strive to choose stronger tech stocks than the S&P 500. This would serve 2 purposes for us. First, the market beta of our portfolio’s returns in excess of the S&P 500 would get much lower; we would be more likely to outperform regardless of market and sector conditions.
The second is that it would give us a stronger chance of finding those standout tickers, as a result from having more stocks from speculative sectors. A tech stock like NVDA is far more likely to have a major bull run than a defensive stock like AWK (tap water services).
On that note, I want to shout out Vlad Kozinets - our long term analyst. Our long term portfolio strategies improved greatly this quarter. During the previous quarter, our long term portfolio under-performed the market by about 5%. This time, our strategies only missed the mark by 0.67%.
During this quarter, we switched portfolios a few times this quarter. Chronologically, we switched:
From a momentum based one to a more defensive portfolio on June 12th
To a different momentum-based portfolio on June 26th
To our current, defensive portfolio on July 10th
While switching portfolios isn’t necessarily a problem performance-wise, it does make development more difficult for our system. In order to test a new update to the algorithm, we need data. Specifically, we need data from after the creation date of the portfolio we test it on. Using training data from before the creation date of the portfolio is a selection bias; that data is not representative of true trends.
This is easier to explain with an example. Let’s say I think NVDA has had a great few months. So, as of today (September 4th, 2023), I add it to my portfolio. Now, let’s say I’m looking at 6 months of price history of the stocks in my portfolio. The data I use to train and test my algorithm now contains NVDA’s performance in May - but NVDA was chosen because it was considered a “good buy” in September. If I were actually trading NVDA in May 2023, I would have no way of knowing it would remain attractive in September 2023. The back testing data is no longer representative of the portfolio or the stock market as a whole. Instead, it’s been artificially weighted with strong performers - something that cannot be guaranteed when trading live.
For this reason, I’m hoping to minimize switching portfolios when we can in the future. The more data we have from a given portfolio, the more confident we can be when testing and implementing updates to our system. If market conditions change, I think changing portfolios will absolutely be justified. But for the sake of performing live development: less is more.
Speaking of development, I’d like to take a moment to discuss another reason we didn’t perform as well as we could have. For a few weeks, we used an experimental algorithm. This algorithm was developed using a portfolio we had only just created, meaning we had no choice but to develop and test the update on data tinged with selection bias. While we took steps to minimize the impact of that selection bias, it proved to be a hurdle we couldn’t overcome. The experimental algorithm, despite doing well in its training and testing data, didn’t measure up when we published it live.
Had we not used the experimental algorithm, and stuck with our current one throughout the quarter, we would have out-performed the long term portfolio by roughly 3%. This would be an expected excess return of 12% per year. This is the reason I’m happy with our results, despite them seeming lackluster. Our algorithm works well, we simply chose poor ways to utilize it this quarter. If we refrain from rolling out new versions without extensive and high quality back testing data, in addition to live paper trades, we should be able to expect that level of performance in the future.
I was hoping this would enable us to operate on a more dynamic framework. We would be able to update the portfolio and algorithm simultaneously, to respond rapidly to changes in market conditions - both with fundamental and technical analysis. But the need for extensive data, and the lack of any effective way to counteract the selection bias have made for insurmountable hurdles. For now at least, if we change portfolios, we’ll probably have to stick with the same algorithm for some time.
Ultimately, I think we’re in a great place. In the last 6 months, the algorithm is up roughly 8.5% relative to the portfolios we’ve fed it, and if not for my experiments, it would be up more than 10%. At this point, we could turn the algorithm off for the next 6 months and we’d still have a great year. Obviously, we’re not going to do that. Development continues, and there’s still plenty of money to be made in the markets.
Lessons Learned And Future Plans
To prevent a similar incident with an experimental algorithm, I’m going to be using the following rules in future developments for the daily algorithm:
Algorithm updates must be developed and tested on >6 months of data
Said data must be from after the creation of the portfolio used. Even if it’s only a month or two before, it’s not acceptable
Updates must be paper traded with live market data for >1 month before being considered for release to users
Additionally, I’ve been talking to Vlad about reworking our portfolio to more closely follow the S&P’s sector distribution. There’s a lot of discussion to be had before we determine whether this is really the best move for us, but there’s a possibility we switch portfolios again.
Lastly, as for what’s currently in the pipeline: work is ongoing on an updated intra-day alerts bot. This is currently in live-testing, in a staff-only server. If it performs well during this test, it’ll replace our existing intra-day bot. If not, we’ll see if we can rework it to perform well, or if it needs to be scrapped entirely.
I’ll be working with intra-day systems for the near future. We expect to see the most value here, as opposed to additional research on our daily algorithm, at this time. If any of these models fare well, I would expect a more consistent, and more profitable bot to be rolled out.
Thank you for reading. Good luck, and have a profitable quarter!