Now that almost all crypto markets are red, I thought I should write about Dollar Cost Average as a strategy for reducing timing risk while continuing to invest without stress.
If you do not know what DCA is, it is a simple investing strategy where you put money regularly into an asset no matter its price. It can reduce risk and sometimes it can produce better results. How often or how much to invest depends on many factors. I am not a financial advisor. I am writing about the idea of analyzing historical data for DCA versus investing all the money from the beginning and holding.
Dollar cost average script in Ruby
I wanted to know what the final result would look like for each case. What would have happened if I had done a simple DCA instead of investing everything at the beginning and waiting? So I wrote a small Ruby script to measure it.
Read the dca.rb script on GitHub Gist.
Script explanation
The script is a bit of hacky code. In the Monero data set I tested, investing 30 dollars consistently with DCA would have earned more than investing the whole amount once at the beginning and waiting. Of course, I chose Monero and this historical data set because it is one of the exceptions. Most of the time DCA would have earned less than investing everything from the beginning. The main advantage of DCA, in my opinion, is that it can reduce timing risk.
A useful addition would be to see how many times each strategy went negative or lost more money than the total investment.
You can find historical data almost everywhere, both for stocks and crypto. I got the Monero data from CoinMarketCap. Do your own research, take the script or write your own and run it on your historical data. I tried it on many assets and stocks and I still prefer DCA for my own investments.
Last words and next articles
This was just a warmup. In the next article I wrote about how I use DCA to invest automatically on crypto without thinking about it too much. I covered the automation and how it can be achieved through Binance and Kraken.
When I wrote the original post, I had counted the first 1000 crypto assets and saw 37 positive assets versus 963 negative assets in the previous 24 hours. I used this kind of market information in an algo-trading bot. I may show in a future article how I fetch it and other ways I think about using it.