Take Profit with defined lot size - script - not EA

 
Hello Traders!

I was wondering - is there a script that will work similar to MT4's TP but instead closing entire position will close only a part ?
For example at X price - close 0.04 lots out of 0.10 = 0.06 still open.
At the moment I'm using EA call OneClick Trader which has this option built-in but I don't want use this type of EAs any longer...