EA to modify exisrting order?

 

I am working on an EA where I want it to close out 1/2 the existing order on reaching a specified TP, and then moving the stop loss to +10pips of the entry price, then sending me an alarm.

How can I right click over an order and enable this in the code or would I need to type in the Order number and start the EA?

There would be various order numbers and TPs