This sub loves DCA and we also love buying dips. So I thought I’d share the algorithm that I use for my weighted DCA strategy. DCA allows us to buy more units at lower prices due to even payments at each time period but what if we alter the payment size depending on the asset price? This will allow us to buy even more assets at lower prices, especially in a crabbing market with BTC pissing about between 30-40K for the past month or so. I’ll apply this strategy to BTC but I personally use it with all of the assets that I am accumulating. Let’s get to it.
Before we start, we need to decide on some parameters, namely:
– the maximum price we want to pay for BTC, P_max;
– the minimum price we assume BTC may reach during the period, P_min;
– minimum payment each period, D_min;
– maximum payment each period, D_max.
Say I have $10000 that I want to invest over the next 6 months, but I’m willing to put it in within the next 2 months if prices are low enough. Then, if I’m making weekly purchases, my minimum and maximum payments would be 10000/26 = 384.61 and 10000/13=769.23, lets round to $385 and $770.
A reasonable max price to pay for BTC would be $40000, and a floor guess of $20000.
So we want a function that will increase as price decreases. We could pick a simple linear function, but we want to conserve funds if prices are close to our max buy price. We use a function of the form
So as the price decreases, we can increase our purchase amount exponentially. Now, we can define a parameter that allows us to control how aggressive we want to be. The more aggressive we are, the more we buy as the price decreases and wait if the price is higher. If the price decreased slightly from our maximum buy of $40000 to $39000, an aggressive buyer wouldn’t increase the amount they are buying. If we wanted to be neutral an aggression parameter of 50% would mean that if the price was $30000, we’d buy about $577.5 on that given day (halfway between our minimum and maximum purchase amounts).
So how can we use our aggression parameter? Well, we can define the point between $20000 and $40000 at which we would make a buy of $577.5 (the halfway spot of daily purchase). The more aggressive we are, the closer we’d like this spot to be to $20000.
If we give ourselves an aggression value of 80%, this point will be 80% of the distance from P_max towards P_min. This is the point where we make a purchase of size midway between minimum and maximum daily buy.
Okay so with an aggression factor of 80%, we have three points that we can fit our quadratic curve to, finding our parameter vector β. We can see that it’s much more aggressive than a linear line between $20,000 and $40,000. Here we have a price between $228 at P_max and $457 at P_min.
This aggression parameter is a trade-off between taking advantage of larger price drops and making larger purchases altogether. We don’t know whether the price will drop down to (or below) $20000, if it does, our average price will be dramatically reduced, but if it doesn’t, we’ll be holding a lot less BTC.
So, how would this strategy have faired over the past two months? I’m bearish on BTC and even I think 80% aggression is a bit high. Running the model with 70% aggression parameter, aiming to inject $10000 over a maximum of 2 months and a minimum of 1 month gives us the parameters:
with these parameters over the past two months. The buy amounts are:
We can see that the adapted strategy takes advantage of the lower prices. The average price of the standard DCA strategy is $38,550, whereas that of the weighted DCA is $38,400. Not a huge amount of difference. But we can see that the price doesn’t go near the expected floor.
What if the price of BTC continued in a downward trend?
Creating a simple random walk, where BTC drops 1000 with probability 0.8 and increases 1000 with probability 0.2, we can create compare the two strategies:
This is where the weighted strategy comes into its element. Admittedly, with a set amount of capital, the weighted DCA will run out of money before the end of the time period. Despite this, the aggressive strategy still picked up more BTC and at a lower price (0.35 BTC at an average price of 28613 vs 0.3 BTC at a price of 33506).
If a fast drop happened towards the beginning of the period followed by a recovery of the price, we should see the weighted-DCA take advantage of the temporary lower price:
Again, the weighted DCA uses up its capital much quicker but accumulates at much better prices. The weighted DCA picks up 0.485 BTC at $20,387 whereas the standard DCA accumulates 0.39 at $25,640. The difference in performance here is stark here as this (manhandled) situation is one where the weighted-DCA will be most powerful.
So, over a long period, what will do better? We’ll see, I’m running this method now and will compare it to standard DCA once we achieve the next all-time high. But in this crabby market, it is doing slightly better than DCA.
If you guys are interested, I’ll create a google sheet where you can play around with your own values. Even if you don’t want to follow it by the book, it could be good as a sanity check whenever you’re making a large purchase.
Edit: just whipped up a little sheet with the payment calculator. It’s super bare and I’ll all some tabs tomorrow with maybe a price simulator or something.