Help me to develop An EA which close any buy order if it above TP and Close sell order if if below TP

 
Hello Developers, I want you to help me develop very simple EA an EA which close any BUY ORDER if it above TP and Close any SELL ORDER if it below TP. I want this EA to continuously monitor the trades on the chart on which it will be attached. There will multiple trades with same TP and TP will keep changing as Market progress and if one Buy Order is below TP may be on next Open trade TP shifted below to Previous BUY Order and it will be above the newly open trade and that can go to many fold if market keep progressing against the trade. I hope you got the picture that what I really want. 
 
Note:- I want this EA to align with my previously attached EA which will actually executes these trades!
 
Reason: