Working with cTrader Projects in Xen AI
What Projects Are
Xen AI projects allow you to save your work while building cTrader cBots, indicators, and other trading tools. Each project stores your latest code, description, and working context so you can return to it later without starting again. Instead of copying code between sessions or relying on memory, everything is kept structured in one place.
This makes it easier to treat each cBot or indicator as its own development project, with a clear starting point and a reliable version to continue from.
Xen AI – cBot Project Overview Demo
Watch this video for a quick understanding of Xen’s project feature.
Tip: Set the video quality to HD (1080p) for the best viewing experience.
Why Projects Matter
When developing trading tools, your code evolves through multiple changes, tests, and refinements. Without a structured way to save progress, it quickly becomes unclear which version is correct or currently being tested.
Projects solve this by keeping your latest working version accessible and organised. They also allow you to return to previous work without re-pasting code or rebuilding context. This becomes increasingly important once you are working on more than one tool at the same time.
In practical terms, projects help you:
- keep your latest code base available
- reload work instantly
- manage multiple tools without confusion
- reduce the risk of losing working code
When to Create a Project
You should create a project as soon as you begin working on a tool that will require more than one step to complete. This includes building new cBots or indicators, modifying existing tools, or testing ideas over time.
A project should represent a single trading concept or tool. Keeping projects focused in this way avoids confusion and ensures Xen always works with the correct code base.
Saving Your Latest Code
Saving your project ensures that Xen always has access to the most recent version of your code. This should be done regularly, especially after meaningful progress has been made.
A practical approach is to save after reaching stable points in development, such as after generating a new tool, fixing an error, or confirming that a version works correctly in cTrader.
- after generating a new tool
- after fixing a compile error
- after adding a feature
- after a successful test
Frequent saves keep your project aligned with the version you are actively working on.
Loading an Existing Project
Loading a project allows you to continue exactly where you left off. When opened, Xen uses the stored code and description as the current working context, removing the need to paste code again.
This ensures that any new changes are applied to the correct version and makes it easier to continue development across multiple sessions or after a break.
Managing Multiple Projects
As you build more tools, projects allow you to keep everything separated and organised. Each project acts as its own container, helping you avoid mixing different strategies or indicators.
Use clear and descriptive names so you can quickly identify each project. This becomes important as your number of tools grows.
Publishing Code to cTrader
Xen is part of the development workflow, but validation happens in cTrader. After generating or updating code, you should move it into cTrader and confirm that it compiles and behaves as expected.
A typical workflow is:
- Generate or modify code in Xen
- Save the project
- Copy or export the code to cTrader
- Compile and test
- Return to Xen for improvements
This loop ensures that your tool is continuously tested as it evolves.
Saving Code to Your Computer
Projects are useful, but they should not be your only backup. You should also save a local copy of your code to your computer to maintain full control over your files.
Local copies allow you to:
- keep independent backups
- compare versions
- edit code manually
- restore previous work if needed
Using both Xen projects and local files provides a more secure and flexible workflow.
Recommended Workflow
The most effective approach is to build gradually and validate each step. Start by creating a project and generating a basic version of your tool. Once you have a working baseline, test it in cTrader, then return to Xen to improve it.
Repeat a simple cycle:
- build
- save
- test
- refine
This keeps development controlled and avoids unnecessary complexity.
Working with cBots
cBots often require multiple rounds of refinement, especially when testing under different market conditions. Changes may involve entry logic, risk management, or execution behaviour.
By saving each stage within a project, you ensure Xen always works from the correct version. This makes it easier to iterate without losing progress.
Working with Indicators
Indicators also evolve during development, particularly when adjusting calculations or visual output. Projects help you track these changes and maintain consistency.
Whether you are adding parameters, signals, alerts, or visual improvements, saving the indicator as a project keeps everything organised and easy to manage.
Avoiding Version Confusion
One of the most common issues is working with the wrong version of code. This usually happens when the version in cTrader does not match the version stored in Xen.
To prevent this, keep your workflow consistent and ensure your project always reflects the latest tested version.
- save after important changes
- test the latest version
- reload the correct project before editing
Maintaining alignment between Xen and cTrader reduces unnecessary errors.
Best Practices
Keep your workflow simple and controlled. Use one project per tool, save regularly, and test each change before moving forward. Avoid making multiple major changes at once, as this increases the likelihood of errors.
If cTrader shows a compile error, copy the full message back into Xen so it can fix the correct version of the code.
Common Mistakes to Avoid
Most issues come from workflow problems rather than the tool itself. Common mistakes include:
- mixing multiple tools in one project
- forgetting to save changes
- testing outdated code
- not keeping a local backup
- making too many changes at once
A structured and consistent approach will prevent most of these problems.