DCA Mode: Required change

Apparently the required change doesn’t take care of the average price of the deal before adding the safety order. If we configure a required change that is already bigger than the current required change of the deal, this should be taken into account.

I’m not sure that I understand you correct. Can you show an example?

What would I expect the `required change to do

If I configure a take profit of 0.1% and a DCA level at -20% and a required change of 5% the safety order should calculate the volume such as that the current required change of around 25% should become 5% to take profit.

But

If I instead configure a DCA level of -1% which required change is already smaller than 5%, this safety order mustn’t add funds.

If I instead configure a take profit of 5%, the required change to take profit never can be smaller than 5%.

And there’s also something different

Also take profit and required change percentage seem to be connected. If I change one the other changes as well.

Final question

Would it be helpful if the required change wouldn’t refer to the minimum take profit level but to the deal’s break-even level?

And in addition to the Maximum order amount, we also need to be able to limit the funds per deal. Especially if it comes to indicator based safety orders where the required volume can hardly be calculated in advance.

I don’t really understand what you mean. I need to see a specific example.

What exactly was left unclear?

When I edit either Take profitor Required change the other value becomes the same.

Example of an expected possible setup

Configuration

I can configure take profit =1% and 5 geometric safety orders that are 6% spaced starting from the take profit level, i.e. order step = 4.71% and step scale = 0.95. The required change can be configured to 3% - without changing the take profit to 3% as well.

Result

Similar to that:

image

The prices are calculated by:

  • $100
  • $100 * 1.01 / 1.06^1
  • $100 * 1.01 / 1.06^2
  • $100 * 1.01 / 1.06^3
  • $100 * 1.01 / 1.06^4

The added Funds were calculated that the required change to break-even is around 2%, i.e. the one to take profit is around 3%.

Remark: The Req. Change at the last step is to break-even.

No I mean tell me what the bot does and what yo expected it to do, with concrete numbers.

I gave you an example. I cannot configure it because take profit and required change are always the same.

What I can do is configure

  • Base order = $10
  • DCA orders = 4
  • Required change = Take profit = 3% (currently they are automatically the same)
  • Order step = 4.71%
  • Step scale = 1.05

The DCA Order amount is irrelevant and could be hidden as it isn’t taken into account for the Required change setup.

The result of those settings is:

The deviations are almost the same with that setup, but the Quantity doesn’t fit at all.

I am sorry. Maybe I have to update the calculations. They are correct but don’t show a geometric spacing currently. I update that later.

The prices should have been calculated like:

  • $100 * (1.01 / 1.06)^0 = 100
  • $100 * (1.01 / 1.06)^1 = 95.28
  • $100 * (1.01 / 1.06)^2 = 90.79
  • $100 * (1.01 / 1.06)^3 = 86.51
  • $100 * (1.01 / 1.06)^4 = 82.43

I recalculate the required funds later.

I don’t know where you got that formula, but as far as I can tell there is no bug.

How is it meant to work then? Why are take profit and required change always the same. Why can we configure a DCA Order amount, that isn’t used?

So in my opinion this is still an open Bug Reports, because the required change to take profit after adding a safety order isn’t 3% and the used volumes are way to high.

Brother the definition of the required change is the change needed to reach TP, so the tp and required change is the same.

Wrong. The base order can have a take profit of 1%. After adding a safety order the take profit is still 1%. But the average price of the deal is so close to the current price, that the required change to take profit is 3%. That is the required change to break-even, that is to reach the average price of the deal from the current price of the currency, is around

  +3%  / +1%
= 1.03 / 1.01
~ 1.0198
~ +2%

By the way,

from, that you use?

I derived my formula from scratch and also verified it.

  volume scale for deal
= (take profit change 
  - required change * current price / average price)
  / (required change - take profit change)

By multiplying the deal’s total volume with this volume scale you get the size of the safety order.

It would also be great to discuss a subject to the end before setting it to not-bug. Bugs don’t disappear because of that tag.

Is not a bug, this is expected behaviour.

Why do you think that this is the expected behaviour? What formulas do you use? Is there a documentation about it?

For me those results appear to be wrong for the reasons I explained above.

  • No separation between take profit and required change despite those are different and the first always smaller than the first

  • Average price not taken into account

  • Required change after adding a safety order isn’t as configured

  • Higher fund usage than required to change the average price of the deal, that the required change is as configured

  • Display of DCA Order Amount though not relevant for required change

  • After switching to Custom or Technical indicator the required change is visible at first but than disappears forever until the page is reloaded

  • Required change is only available for Scaled but no other option

Feel free to prove me wrong and I am the first to admit my mistake.

But as I currently see it, with that implementation that feature is fully useless for me.

And I would also warn everybody else to currently use it.

Maybe @Iamtheonewhoknockss, @EmuMoon or @ttpbots could check our comments, since they have implemented that feature in their strategies as well.

You have a different interpretation of what required change means. Required change to breakeven doesn’t really mean anything, you are still not at TP. So required change to TP seems like the most logical option.

There is the example orders for deal table on the bot, I have checked and there are no bugs, everything is working as expected.

Yes, my idea of required change is also to take profit.

Check volume factor to take profit:

I only mentioned that my current Trading Simulator only calculates the required change to break-even, because I haven’t extended it yet.

Well required change can be to breakeven or it can have TP% added into it

I personally like RC to breakeven that way someone using low TP doesn’t end up using high funds in deal compared to high TP.

I am unsure how Gainium implements it but there are two kind of dynamic dca types

Basic volumes where your volumes are predefined as per normal dca settings but cumulative volumes are added when min gap % from previous order in the deal maintained and indicator is True.
Example
Base order at 100$
Normal dca settings SOs levels at 98,96,94,92,90$
Normal dca settings SOs volumes are say 1,2,3,4,5$
If base order is executed at 100$ and next time indicators are true at 95 you add 1+2=3$ worth basic volumes SO at 95$
Next SO can be added at no closer than 93$ price even if indicator is True as min gap% of SOs at that those settings levels is to be maintained

Dynamic volumes
Again same normal dca settings
Base order at 100$
Normal dca settings SOs levels at 98,96,94,92,90$
Now instead of SO volumes we have required change %s of the normal dca settings
Say Normal dca settings RCs are 2,3,5,7,10 %
Then at 94$ price if indicator is True, the system must add a dynamic SO volume which makes RC = 5%
While conforming to max deal size limits and the min gap% of SOs at that those settings levels is to be maintained

Hopefully this simple explanation helps

Yes, using required change to break-even surely has the benefit, that it’s independent of the take profit. It could be a choice what the reference shall be.

Your first explanation is how another bot provider does it.

At Gainium you can limit the funds per safety order and those of the deal. The Scaled setup seems to be the only, that currently supports something called required change, which was meant to change the deal’s average price with at maximum the configured funds that the required change to take profit becomes as configured.

Currently there’s no dynamic setup though, because it is executed in any case as soon as a level is reached. It also isn’t available at Technical indicator and Custom respectively is shortly shown but not functional, results in glitches and then disappears completely until a reload of the page.

The following example shows the correct calculations. Gainium apparently uses others.

An example with take profit

Base data

  • TP 5%
  • Base price $100
  • Base size $10
  • RC 25%
  • DCA price $50

Derived take profit price

  $100 + 5%
= $100 * 1.05
= 105

Derived deviation at DCA price from last order

  $50 / $100
= 0.5
= -50%

Derived deviation at DCA price from current take profit

  $50 / $105
= 0.4761904762
= -52.38095238%

Derived required change to break-even at DCA price before adding a safety order

   $100 / $50
(= 1 / 0.5)
 = 2
 = +100%

Derived required change to take profit at DCA price before adding a safety order

   $105 / $50
(= 2 * 1.05)
 = 2.1
 = +110%

Calculated required volume scale

  (+5% - +25% * $50/$100)
  / (+25% - +5%)
= (1.05 − 1.25 * $50/$100)
  / (1.25 − 1.05)
= 2.125 

Resulting volume

  $10 * 2.125
= $21.25

Resulting average price

  ($100 * $100/$10
    + $50 * $50/$21.25)
  / ($100/$10 + $50/$21.25)
= (1 + 2.125)
  / (1 + 2.125 / 0.5)
  * $100
= $59.5238095238

Resulting take profit price

  $59.5238095238 + 5%
= $59.5238095238 * 1.05
= $62.496

Required change to take profit from current price

  $62.496 / $50
= 1.25
= +25%