Close part of the order and trailing stop

 
 Hi every one
 I'm having some problem with coding the closing order and trailing stop
example: I've bought N lot size and stoploss at -X price.When price go to +X,i want to close 25% of the lot size  and move the stoploss to buy price.After price go to +X.2,i will then close all the position.
Can u guys help with the mlq5 code ?
 

Trailing stop in the CodeBase ... https://www.mql5.com/en/search#!keyword=trailing%20stop&module=mql5_module_codebase&page=2

Partial close in the CodeBase ...

Code Base

closing partially script and Stop loss to Break Even point

Mehmet Bastem, 2021.06.24 16:55

closing partially script and Stop loss to Break Even point

 
tks appreciate Fernando Carreiro #

Trailing stop in the CodeBase ... https://www.mql5.com/en/search#!keyword=trailing%20stop&module=mql5_module_codebase&page=2

Partial close in the CodeBase ...


Reason: