Can't see the logic
-
This is part of my first complex EA and there is something I don't understand abour 'For each position' block. I created to groups of trades (1 and 2) with different launching setting and they work fine. My problem is closing them. I have different setting for each group. Like this:
https://fxdreema.com/shared/ViXqEDb4
Theoretically, every group 2 trade should have its own Sl level because they open at different prices. However, I don't know why but all of them shar the same SL level after the second group 2 order is launched.
Additionally Group 1 and 2 share the same amount of pips away from open price to be closed. Again, I don't know why when any group 1 trade reaches that amount, all group 2 trades are immediately closed at that exact price an not at the one they are supposed to.
Any idea why?
-
It is related to the logic used between blocks, respectively a mismatch between input parameters.
If the input parameter "Onsatura" is 50 (pips) and the input parameter named "MouaBE" is "0", then the stops are modified to the null and the trade is closed. Set the "MouaBE" to 100 or so and everything should working fine

....
apply to your testing a "test buttons" for trades opening and it will give you the possibility for better testing:


-
An impressive explanation as usual, miro :). However, before trying to use your suggested buttons I would appreciate additional info. Let me explain a bit further.
'MouaBE' constant is the amount of pips SL is 'moved to Break Even'. This is why it will never have a higher value than 'Onsatura'. This second constant is the amount of pips the trade is to be closed.
And this is wher things go weird for group 2 trades. Let's say Onsatura is 80 pips. What I want is that both group 1 and 2 trades stop at 80 pips from its open price. However what happens is that all trades are closed when the first group 1 trade reaches that level (as intended), no matter where all group 2 trades are (usually less than 80 and not intended).
Why are two clearly separated group conditions entangled when they are clearly not sharing the same blocks?
-
... ... ...
-
Actually, it seems be working right ...
when the input parameters are:
- Onsatura=200
- MouaBE=100
Then both, buy1 and buy2 are opened right, also BE for buy1 is working:

then, buy1 is closed because Onsatura is reached, and buy2 still waiting for own Onsatura level:

-
Interesting. This is what happens when you show the part of your project that is supposed to be wrong and then it works on its own!
Obviously there must be something wrong in the rest of it. Would you mind if I send you a PM for a more precise question? -
yes send it, I hope it is not very complicated and big project
