Modify pending orders after position close
-
Hi @all, I'm new to fxDreema and trying to build a kind of breakout strategy. When the EA open a new position, also a pending order in the opposite direction opens for a breakout chance. The pending lot size is always calculated in reference to the opened positions. So, when a new position opens, then a new calculation will be made for the lot size of the pending. This works well. After a position close in profit, the same calculation has to be done but at this time the lot size of the pending order will be reduced.
I created the same calculation after a new position and after a position is closed. After the new position it works well, but after the position closes it does not work.Here is the link of this calculation. Anybody have an idea where I have an error?
thx and best regards
Markus -
Here is the right link... https://fxdreema.com/shared/fqqsHUNeb
-
What is the part that is not working correctly?
-
Let's say we have 10 open positions with lot size 0.01. The total lot size then is 0.1 and our pending order would be 0.2. Now if one of the open positions close in profit, we have 9 open positions with a total lot size of 0.09 and the pending order should change to 0.18. This does not work. the pending positions are not deleted and not replaced with the right lot size.
-

This whole part does not work right and I don't know where the error is
-
Then you need to reconfigure the whole structure. If I understand correctly, there should be 2 different lot size levels to be considered. Firstly, the combined lot size of all current trades should be 0.1 whereas the second level is doubling the first one. Right. Then any possible intermediate combination is possible. So for example:
Level 1: 6 open trades for a combined lot size of 0.06.
Level 2: the pending order should be programmed with 0.14 lot size.
Is that correct? -
Yes correct and in the meantime, I found a solution. thank you
-
@MS_fxDreema You're welcome.