Mt4 - Order type instruction

 

Hi all

I am using Scorpion's HMA EA on mt4 and i need to add the following

Lets say i have a BUY position, when I close the position (either manually or tp) the next order should be a SELL and vice versa.

How can I code this into my EA?

Thank you

Reason: