I got the idea from this article: https://quantdare.com/elo-system/ and decided to work on it in my free time.

For those of you who don't know, the Elo system was invented by Arpad Elo as a way to rank chess players. The idea behind it being that there is no true way to know the skill of a player, but that each player has a skill level. The information we do have access to is the games that the players have played.

This situation bears similarities to stocks in the stock market, we know that there are stocks that are "better" than others, but we don't have a real way of knowing. This algorithm sets each of the sectors against each other every week in a "matchup" in which the winner is decided by who had the higher return adjusted for volatility (I'm unsure on my implementation of this, definitely open to review there). These matchups are used to calculate the Elo rating of each sector. I use a low K factor here (2, much lower than the minimum 10 used by the FIDE for experienced players), and this is because I'm exposing all the sectors to a repeated amount of games every week and they have no choice in opponent, so I wanted to minimize the volatility of the ratings.

When you have the Elo ratings, you can calculate the expected value of a matchup, or as I understand it, the probability of victory. For this algorithm, I go long the highest rated sector, and short the lowest rated sector, and adjust the weights for volatility. 

A few further things I want to look into with this system is the use of it with low or uncorrelated stocks/funds, using the ratings to build a weighted portfolio based on the ratings, and the idea of using other similar rating systems such as the glicko system. 

https://en.wikipedia.org/wiki/Glicko_rating_system

Author