I am currently on a trip trough Europe, and I have met some interesting individuals whom have recently realized large gains in crypto. I've decided to spend the weekend writing some code to help me learn a bit more about investing/trading in this space. As a bonus, I have also hacked together a simple trading strategy.
I would have about $140,000+ right now. That is an insanely good 14x yearly gain, most of which has been materialized in the past 2 months.
Picking top coins has some survivor bias built in, so I've wondered about how the random portfolios would do (think Dr. Malkiel's Monkeys experiment). Here is an example of 15 portfolios comprised of 10 random coins, yielding $30,000 to $400,000 in returns.
Feel free to tweak the params and generate more portfolios on your own.
The variance on returns of different coins can be quite large, for example, here are returns on some top coins for the past 30 days.
To deepen my understanding of variance and correlations, I've built some interactive charts to display returns from different coins, as well as normalized returns versus an arbitrary benchmark (ie BTC).
Please, feel free expand the size of the universe, and play with the chart interactively in your notebook.
The idea behind this strategy is simple - we want to buy the coins that are rising in value, and drop the coins that are not doing so well. I have picked the parameters haphazardly and I've avoided optimization to avoid the risk of curve-fitting.
We rebalance our portfolio weekly.
Rules:
Strategy:
Filters:
The whole strategy can be succinctly described using a few helper functions.
Before I go any further, I should mention that this strategy is very simplistic, and it suffers from serious biases/flaws. It is in my opinion not suitable for real-money trading, and I should explain why, and work on improvements for my next post.
The results on trades from 2017 look promising, as the backtest of this system yields $73,815 in value (7x gain in less than 6 months).
It would be good to know how does this strategy compare to buy-and-hold and random buy-and-hold strategies above. Well, it totally bombs, as we go nearly broke ($3438 of initial $10000). Maybe our strategy is only suitable for the recent market, or perhaps I have bugs in my code.
To be continued...
Source code for data gathering/cleanup, analysis and the trading strategy is available here. Use at own risk (see disclaimer).
This project is for educational purposes only. The code provided is not suitable for real-money trading, and comes with absolutely no warranty.