Quick Question on Modifying SL&TP of different orders based on the close of a first order in an EA

 

Hi Guys, 

First time posting here, with just a quick question about how to approach coding the following into an EA I'm working on. The psuedocode is something like this:

EntrySignal is true -> Open 3 positions each with their own TP & SL

If position 1 hits TP1, then positions 2 and 3 modify their SL to entry.

I know I'll be using the OrderModify function to modify the other positions, but how do I set it an EA to find the position that was closed, and then find the other 2 positions that were opened immediately afterwards? Just a few tips on how to go about this would be much appreciated!

Cheers

 

You can use OrderSelect to find the specific order