TAG a TRADE

 

What kind of code can I add that will add a tag to a trade when it meet certain conditions?

For instance, I have 3 or 4 trades in. One of my trades goes to -20 pips. At that point, a hedge trade gets put in. How can I tag that trade so the hedging portion of code will not keep re entering trades because the first trade is repeating to -20.

As you can see, it would be very possible for the trade to go to -21 and back to -20 or -19 and back to -20 etc. I don't want multiple hedge trades for the same trade, just 1:1.

 
You can use OrderOpenPrice of the hedged position as a MagicNumber of hedging position.
Reason: