Closing half of the lot
The script works on MQL4.
If a certain number of market orders is initially opened in the terminal, once started the script iterates over all the running orders and closed half of the lot of each order.
The script works only on market orders, pending orders remain unchanged.
If the script is run again after its first start, at the next start it will also close the half of lots of the open orders, and closure will comprise the half of remainder after the first lot closure.
This script has no manually entered parameters, it begins working right after it is started and is configured to close 50% of the lots.
The script can be used when it is necessary to preserve a part of the reached profit, but there is still a possibility that the price will move further.