Close trade at X pips profit after it was in Y pips negative DD
-
Hello,
Can you help me with this? I would like my EA to close a trade when it was in Y pips negative pips, but not at 0 like break even, but at X pips profit.
Thank you very much in advance!
-
pips away -Y pips from open set flag true, if true and +pips from open close trade
-
Thank you! Like this?

-
Add a share link so block internals can be seen. This should be in 2 trees for each tree starting with a for each trade block, 3 blocks for each tree.
-
-
This should work fine, is it doing what you need? this needs a trade placed and you want to set the flag back to false, the flag may start false so you may want to reverse, maybe reset flag under the close block.
-
@jstap It doesnt take the DD beforhand into consideration, it just close trade when it is in X pips profit.
I am trying to figure it out why -
Is probably the flag state, you want it to only allow the close if DD already considered. You could use a bool variable so you can see the state in a comment.