Where to find a script for closing half position from open order?

 

If you have seen script like this..please send me a link where I can find it!