DCA Calculator - PTMagicians/PTMagic GitHub Wiki

The DCA calculator helps you to find good settings for the Profit Trailer DCA strategy. The key is to find a balance between 4 values:

  • Trading pair count (DEFAULT_max_trading_pairs in PAIRS.PROPERTIES)
  • The price for the first buy (DEFAULT_max_cost in PAIRS.PROPERTIES)
  • DCA levels (max_buy_times in DCA.PROPERTIES)
  • Your BTC balance

If you set the wrong values you probably run into problems. For examle, if your DEFAULT_max_cost (the amount Profit Trailer uses for the first buy of a pair) is too high you may spend your complete BTC when entering higher DCA levels in a bearish market. You will end up with some bags with high percentages.

How does the DCA calculator work? (Simple example)

You experiment with some values by entering them into the fields shown below.

In this example we set a "Max Cost" of 0.0012, 6 pairs and a maximum of 5 DCA levels. The table now shows the point where our balance (0.18139279) will be exhausted (red numbers). As you can see the 0.0012 BTC is the value in the uper left cell for buying 1 charge of a pair with DCA level 0.

Using 5 DCA levels means that our balance will work for 4 pairs if ALL pairs use the maximum DCA of 5. The other box above the table shows that we will exceed our balance by 27.02% which is ok assuming that not all pairs will go down to 5 DCA levels. Having 6 pairs the maximum DCA would be 4. So if you want to be absolutely safe, use these values.

DCA calculator modes

For DCA Profit Trailer uses the Anderson Double Down method which basically helps you to lower your average buy price to limit the level your bought coin has to climb back up to, to make profit aka get out of this bag.

The Anderson Anderson Double Down method will in fact double the amount of units you already bought of a certain coin at the new (lower) price to build a new (lower) average buy price.
Most DCA calculators just double the costs for each DCA level, which is of course very safe in regards to not over extending your balance, but it is quite inaccurate as this is not how DCA works in Profit Trailer.

To help people calculating their DCA capabilities in a more accurate (still not 100% accurate) way, we separated the DCA calculator into two modes. Please be aware, that both modes do not take any trailing into account!

Simple Mode

In simple mode the DCA calculator will use the most common calculation to simulate your DCAs, which is simply doubling the cost for each DCA level:

This way you can get a rough overview of how many levels of DCA combine with what number of pairs you may be comfortable to use with your balance. If you do not over extend your balance in this mode, you will always be safe with your DCA levels and may even be left with some balance when all your pairs and DCA levels are used to their full potential.

Advanced Mode

In advanced mode the calculations of the DCA calculator are much more complex but also more accurate. This mode will not only take your number of pairs, DCA levels and max cost settings but also your buy triggers for your DCA level into account for the calculation.

So here is an example where you can see the simple DCA calculation compared to the advanced calculation with some triggers set for 5 DCA levels:

So what is this?

Ok let's go over the columns:

DCA Level This is the level of DCA for the calculation starting at 0, which represents your initial buy using your max_cost.

Trigger % Your buy triggers for the DCA level including your buy_value setting for DCA level 0 (your initial buy).

Approx. Drop % This is the approximate total drop of your trade coin. So for example if you bought BTC-ETH your first buy (DCA 0) happened at approximately -0.75%. The first DCA trigger will be hit at approximately -1.50% and lead to a new average buy price. From that new average buy price the calculator will calculate the next drop % using the DCA level 2 trigger.

Example

1. The current price for BTC-ETH considering EMAGAIN is at 100
2. Your initial buy of 1 BTC-ETH will happen at a price of ~99.25 (at -0.75%)
3. Your DCA 1 buy of 1 (2 units total => units doubled) BTC-ETH wil happen at a price of ~98.50 (-0.75% below your first buy price and ~1.5% below the original value of 100)
4. Your new average buy price will be ~98.87
5. Your DCA 2 buy of 2 (4 units total => units doubled) BTC-ETH wil happen at a price of ~97.39 (-1.5% below your avg. buy price and ~2.61% below the original value of 100)
6. Your new average buy price will be ~98.13
7. Your DCA 3 buy of 4 (8 units total => units doubled) BTC-ETH wil happen at a price of ~95.19 (-3% below your avg. buy price and ~4.81% below the original value of 100)
and so on

So Approx. Total Drop is the estimated total drop needed for a coin to reach that DCA level. So as you can see in the screenshot above, this setup will use 4 quite aggressive DCA levels that only cover a total drop of about -7% for any coin. The last DCA level with its trigger sitting at -15% will then make that overall DCA strategy cover a total drop of approximately -19.62%, not taking any trailing into consideration.

Simple Cost / Pair This is the cost of that DCA level per pair being calculated using the simple mode.

Advanced Cost / Pair This is the cost of that DCA level per pair being calculated using the advanced mode.