closing two hedged trades automatically when reached optimum profit

 

Hi there, 

Can anybody help to close two hedged trades automatically when optimum return of two together reaches at a certain level? there would be a possibility when one would go with loss and other with profit, while overall it hits certain level of profit. For example, crude oil goes in profit and brent oil in loss, while overall optimum return reaches in  profit, they both need to be closed automatically. 

Can anybody help to find or provide script of MT4

thank you.

Kind regards,

Aamir

Reason: