You will find that your code logic is correct; the behaviour is based on the instructions from the code and not the cTrader platform. There are two things to consider.
- Your cBot strategy
- Your cBot code
The cBot code does not follow your cBot strategy. Share your strategy as a written document and your cBot code as a file uploaded; with this information, maybe someone can help you. Without this information, nobody can help you.
If you feel your cBot code is correct, contact Spotware. ClickAlgo cannot help you because they are a different company.