hey I want a very simple EA that closes pending orders and open trades when it hits SL or trailing stop or a TP I do not understand why it does not work :( can you help me please
-

-
@oracle-0 Just separate both tree branches into two separate trees. Blocks 18 and 19 should be on top lf each one. Then block 17 should be duplicated below for both of them. Only time filter can be on top of both new trees.
-
@l-andorrà said in hey I want a very simple EA that closes pending orders and open trades when it hits SL or trailing stop or a TP I do not understand why it does not work
can you help me please:Just separate both tree branches into two separate trees. Blocks 18 and 19 should be on top lf each one. Then block 17 should be duplicated below for both of them. Only time filter can be on top of both new trees.
Thanks a lot @l'andorra
is perfect now -
here is good ?
https://fxdreema.com/shared/Rf9KEUFtc

because I do not understand on the first TP he does delete the Buy stop but on the second TP why does not he do it?
see image of the test reportthanks

-
@oracle-0 No. Block 36 should be below block 31 and and block 50 below block 32.
-
@l-andorrà said in hey I want a very simple EA that closes pending orders and open trades when it hits SL or trailing stop or a TP I do not understand why it does not work
can you help me please:No. Block 36 should be below block 31 and and block 50 below block 32.
ok but look I don't understand why he doesn't close me all after the TP
I put you the shared link because I did as you told me could you look at you please? thanks a lothttps://fxdreema.com/shared/QBQbSLNpd

-
@oracle-0 Ooops, sory. I forgot to tel that all those blocks should be moved to the 'On tick tab'. Do not use in this case the 'on trade' tab.
-
@l-andorrà said in hey I want a very simple EA that closes pending orders and open trades when it hits SL or trailing stop or a TP I do not understand why it does not work
can you help me please:Ooops, sory. I forgot to tel that all those blocks should be moved to the 'On tick tab'. Do not use in this case the 'on trade' tab.
hi thanks a lot for the reponse but this way all works fine
can you tell me what is the best choice please?

-
@oracle-0 Remove that 'For each trade' block and substitute ot for a 'Pass' block. That configuration is connecting two loop blocks and that can lead to some weird results.
-
@l-andorrà said in hey I want a very simple EA that closes pending orders and open trades when it hits SL or trailing stop or a TP I do not understand why it does not work
can you help me please:substitute ot for a
ok thanks for the réponse
and if I take your before idea all must be in the Tick block like this ? is good ?https://fxdreema.com/shared/ltlI3aH4d

-
@oracle-0 Yes, but you forgot to substitute block 39 for a 'Pass' block.
-
@l-andorrà said in hey I want a very simple EA that closes pending orders and open trades when it hits SL or trailing stop or a TP I do not understand why it does not work
can you help me please:Yes, but you forgot to substitute block 39 for a 'Pass' block
ok but in this way it does not work correctly
it does not always put the TPs back and sometimes it opens 4 sell stop while in the sets there must be two I do not understand 
https://fxdreema.com/shared/kdiqQy24

-
@oracle-0 Ok. First things first. Let's begin with those pending orders that are to be closed. You cannot clos a pending order with a stop loss or a teke profit. When are those pending orders supposed to be closed?
-
@l-andorrà said in hey I want a very simple EA that closes pending orders and open trades when it hits SL or trailing stop or a TP I do not understand why it does not work
can you help me please:Ok. First things first. Let's begin with those pending orders that are to be closed. You cannot clos a pending order with a stop loss or a teke profit. When are those pending orders supposed to be closed?
hat's what I want .. I want all Trade open and all pending orders to be deleted or closed when a TP or SL / Trailing stop is hit ... ^^
-
@oracle-0 Then you need this on the 'on Trade' tab:

-
@l-andorrà said in hey I want a very simple EA that closes pending orders and open trades when it hits SL or trailing stop or a TP I do not understand why it does not work
can you help me please:Then you need this on the 'on Trade' tab:
ok and what if he hits the take profit? because I would like it to close all too and when I put the take profit or sell option it does not close all I really do not understand ...

-
@l-andorrà
ha it's good now all works
thank you very much I forgot to change the setting of the "group" 
thanks a lot
-
@oracle-0 You're welcome.