Skip to Content

Calculating Bitcoin returns with mean hodl times using Monte Carlo simulations

Bitcoin’s volatility scares away many investors, which makes sense. If you bought BTC in late 2017, you would be sitting in a deep financial hole for the entirety, so far, of 2018. But te late 2017 run-up subsided quickly, as did the spike in late 2013. On the whole, Bitcoin’s price movement has been, needless to say, upwards.

I had long wondered what the average return would be for someone who bought BTC at a random time over the past five years, and held the bitcoin for, say, one month. I was able to answer this question using a JavaScript Monte Carlo simulation and price data from CoinMarketCap.com ranging 1,972 days from Apr. 2013 to Sep. 2018. The answer – that is, what your return would be if you bought at a random time and held for around one month – is 12.3%.

You can test yourself with the tool below, which runs in your browser and simulates 1 million trials with random hodl times situated around a mean and the normal distribution. I am sure there is a more elegant mathematical solution than a Monte Carlo simulation, plus there are lots of caveats here (the data set starts at the beginning of a big bull run-up, for example).

But brute force is the hedonistic assertion of the worth of the software developer and, so, anyway, below is the tool and the code. Answers should return in a second or two.

Mean hodl time (days):


Mean Hodl Time Fiancial Return
1 day 0.4%
7 days 2.3%
30 days 12.3%
100 days 53.4%
// Array of prices omitted. Prices range 1972 days, 
// from Apr. 28, 2013 to Sep 20, 2018. 
var prices = [];

function monteCarlo() {
        // Some HTML-gathering omitted
        var normalDist = 0;
        var avg = 0;
        var randomStartDate = 1972;

        // Get list of random hodl times, normally distributed 
        for (i = 0; i < 1000000; i++) { 
            var u = 0, v = 0;
            while(u === 0) u = Math.random(); //Converting [0,1) to (0,1)
            while(v === 0) v = Math.random();
            normalDist = Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v )
            stdDev = parseInt(meanHodl) / 3 ;
            randomHodlTime = parseInt((normalDist * stdDev) + parseInt(meanHodl));

            randomStartDate = 1972;

            // Cannot end later than day 1972
            while (randomStartDate + randomHodlTime >  1971) randomStartDate = Math.random() * (1971 - 1) + 1;

            var financialReturn = (prices[randomHodlTime + parseInt(randomStartDate)] - prices[parseInt(randomStartDate) - 1] )/ prices[parseInt(randomStartDate) -1];
            avg = avg + (financialReturn * ( 1 / 1000000));

        }
    }