How to auto-repeat a pending order same as the previous order completed by take profit ?

 
How to auto re-create a pending order same as the previous order completed by take profit.
Any Sample Code ?

Thanks

Matt
Reason: