Modify an Existing cTrader cBot
What this Workflow Does
The Work on Existing cBot workflow allows you to make targeted changes to a trading robot you already have. It is designed for modifying, fixing, or extending existing code rather than creating a new strategy from scratch.
This workflow is useful when you want to correct behaviour, adjust trade logic, or introduce new features while keeping the original structure intact. The focus is on controlled, minimal changes that do not break the existing system.
Watch Video Explainer
Watch this video to learn how to load an existing cTrader cBot into Xen for modifications and bug fixing.
Tip: Set the video quality to HD (1080p) for the best viewing experience.
Supported Platforms
You can submit trading robots or strategies from several platforms, including:
- cTrader (C#)
- MT4 and MT5 (MQL4, MQL5)
- TradingView (Pine Script strategies)
- NinjaTrader
- Other structured trading platforms
If the strategy is not written for cTrader, Xen may recommend converting it first so that changes can be applied correctly.
When to Use This Workflow
Use this workflow when you already have a trading robot and want to change or improve it. This includes fixing bugs, adjusting entries and exits, improving trade handling, or adding new filters and controls.
Do not use this workflow if you are building a new strategy from scratch or converting a robot from another platform. Those tasks should use a build or conversion workflow instead.
What You Should Provide
For best results, always provide the full source code of the robot. Partial snippets are not sufficient, as Xen needs the complete file to apply changes safely.
You should also clearly describe the change you want and, if needed, explain the current behaviour and what should happen instead.
Examples of useful requests include:
- “Add trailing stop loss.”
- “Change entry logic to use RSI instead of MACD.”
- “Add a filter to prevent trades during low volatility.”
- “Fix duplicate trade entries.”
Clear instructions lead to more accurate modifications.
How to Interact with Xen
Be specific about the change you want. Trading robots require precise instructions, especially when modifying execution logic.
Good requests include:
- “Add break-even logic after 20 pips.”
- “Only allow one trade per direction.”
- “Add a time filter to avoid trading during news hours.”
- “Change stop loss and take profit to be ATR-based.”
Avoid vague requests such as:
- “Improve this strategy.”
- “Make it profitable.”
- “Fix everything.”
If the request is unclear, Xen will need to ask for clarification before making changes.
What Xen Will Do
Xen will analyse the existing robot code and apply targeted modifications based on your request. It will preserve the original structure wherever possible and avoid unnecessary rewrites.
Depending on the selected mode, Xen may return a full updated file or focused code changes with guidance on where to apply them.
What Xen Will Not Do
Xen will not rebuild the strategy from scratch unless it is required. It will also avoid modifying unrelated parts of the code or making assumptions about major changes. If your request is too broad or unclear, Xen will ask for more detail before proceeding.
Common Changes You Can Request
Typical updates include modifying entry or exit conditions, improving risk management, adding filters, preventing overtrading, introducing trailing stops or break-even logic, fixing execution errors, and adjusting parameters.
Recommended Next Steps
Before submitting your request, make sure you provide the full source code and clearly describe the change you want. Mention any known issues or expected behaviour to guide the update. If the strategy is from another platform and needs to be adapted for cTrader first, use the Convert a Trading Robot workflow before making modifications.