Working with "Pending Orders", their deletion and trailing of their Stop Loss when triggered in
-
Hey peeps,
I got an actually full working EA and wanted to replace instant execution with pending orders.
The situation:
As you can see in the screenshot the pending order (Ticket 4; red circle) got cancelled.
Another valid pending order was created (Ticket 5; purple circle) and got triggered (Ticket 4; also purple circle).
As soon as the trade reaches 50% of its stop loss size, its stop loss gets trailed with the 1h50EMA.
That is perfectly working, BUT ...
The issue:
... as soon as the EA needs to delete a pending order or a pending order expires, the EA is not trailing the SL at all.
I assume it has something to do with the ticket number, because when the position gets triggered (Ticket 4; purple circle)
it got the Ticket 4 - the same number of the canceled pending order.I think the EA only checks the SL of the same ticket, which is - as in this situation - already closed and nothing to trail is left.
I can I make the EA check the targeted position? In this case I cannot implement any Block, which deletes or expires the pending order.
I appreciate any guess, tip, help and support!
Thanks guys for your help!

-
@umbrellamaker Can you please share the link to your project?