So i suggest a new type of stoploss and exit target in form of stoplimit buy and sell orders that are supported by MT5 that will exit only the contract size taken by the strategy and not exit all like today since all brokers today bulk all trades in to the same ticket. With the code should follow an emergancy stoploss that can be manually set ofcourse if the stoplimit sell or buy is not filled.