Hi.
This cBot: cTrader Profit & Loss Risk Manager (https://clickalgo.com/profit-loss-targets), is not correctly closing all pending orders when the Equity TP or SL are hit, because is using a synchronously method, instead of a asynchronously one. Meaning, when the TP or SL are hit, the cBot attempts to close pending orders one by one, and is limited by cTrader servers very early in the process. The result is that pending orders are not cancelled and the account is not protected.
A simple solution to this is to program the cBot to use a asynchronously method, meaning trying to cancel all pending orders at once, and because cTrader limits the pending orders cancellation to a rate of 100 orders per minute, after 65 seconds the cBot should attempt to cancel all orders again. Then, repeat this process until it detects that there are no more pending orders placed in the account.
I have left this cBot running on a VPS multiple times, an every time it's the same problem: it doesn't cancel pending orders because of the problem I have mentioned. So it's not safe to use and trust.
I have between 300 and 800 pending orders at any one time, and this cBot can't protect the account.
If the modifications could be made, will protect the account correctly and all clients will directly benefit from this, because they will be able to leave the bot running without worrying if the orders are canceled once the TP or SL is reached.
Thanks in advance for your help and attention to this matter.
Lisandro.