Working with Projects and Project Versions in Xen AI
What Are Projects?
Projects allow you to save your cTrader development work so you can continue building cBots, indicators, and plugins over multiple sessions. Rather than starting from scratch each time, Xen stores your latest code, conversation, project title, and notes as a single project.
Each project represents one trading tool. This keeps your work organised and allows Xen to understand the current state of your development whenever you return. As your projects evolve, Xen also creates Project Versions, allowing you to revisit earlier stages of development whenever required.
Xen AI Projects and Project Versions
The following video demonstrates how Projects and Project Versions work together inside Xen AI.
Tip: Set the video quality to HD (1080p) for the best viewing experience.
Why Use Projects?
Developing trading algorithms rarely happens in a single session. As strategies improve, code is refined, bugs are fixed, and new features are added. Without a structured workflow it becomes difficult to remember which version is currently being tested.
Projects provide a permanent home for each trading tool, allowing you to stop working at any time and continue later without rebuilding context. If you work on several indicators or cBots at the same time, Projects also prevent different strategies becoming mixed together.
Creating Your First Project
Create a project once you have generated the first working version of your cBot or indicator. Give each project a descriptive name that clearly identifies the trading tool. You can also add notes describing its purpose or recording important development milestones.
From this point onward, Xen treats the project as your primary working copy.
Saving Changes
The first time you save a project, Xen creates the project and stores its current state. Whenever you later update the same project, Xen saves your latest work and automatically creates a new Project Version. This allows you to continue improving your trading tool while maintaining a history of previous revisions.
A good habit is to update your project after meaningful progress, such as fixing compile errors, adding new functionality, or completing successful testing.
What Are Project Versions?
Project Versions provide permanent revision history for your saved projects. Each time you update an existing project, Xen stores a complete copy of the project at that point in time. Every version includes the project title, notes, AI model, conversation history, and generated source code.
This allows you to safely experiment with new ideas knowing that earlier versions remain available if you need them.
Viewing Project Versions
Every saved project includes a Versions button whenever version history exists.
Selecting this button opens the revision history for the project, where you can review previous versions together with their save dates, notes, and AI model. Before restoring a version you can also inspect the stored source code, making it easy to confirm you have selected the correct revision.
Restoring an Earlier Version
If a recent modification introduces problems, you can restore any previous version of the project. Restoring replaces the current project with the selected version while leaving the remainder of the version history intact. This means you can continue moving backwards or forwards through your development whenever required. Project restoration is particularly useful when experimenting with larger design changes or testing different trading ideas.
Session Snapshots and Project Versions
Session Snapshots and Project Versions serve different purposes. Session Snapshots exist only while your current coding session is active. They support Xen's Rollback feature by allowing you to return to earlier points during the current conversation. Once the session ends or you begin a new task, these snapshots are removed automatically.
Project Versions are different. They are permanently attached to your saved projects and remain available every time the project is reopened.
Loading Existing Projects
Loading a project restores its latest saved state and makes it your active working project. Xen automatically reloads the saved conversation and source code, allowing development to continue immediately without manually copying code back into the chat. This ensures new requests always apply to the correct version of your trading tool.
Working with Multiple Projects
Many traders build several cBots and indicators simultaneously. Projects make it easy to keep these completely separate. Instead of storing multiple strategies in one conversation, create a dedicated project for each trading tool. This produces a cleaner workflow and makes future maintenance much easier.
Typical Development Workflow
A typical Xen development workflow is straightforward.
- Create a new cBot or indicator.
- Save it as a new project.
- Test the generated code in cTrader.
- Return to Xen and continue improving the project.
- Update the project after each successful milestone.
- Restore an earlier version if required.
Following this approach creates a complete development history while keeping your current project up to date.
Saving Code to Your Computer
Although Projects provide excellent organisation, they should not replace your own local backups. Saving source code to your computer provides an additional level of protection and allows you to archive completed projects independently of Xen. For important commercial trading systems, maintaining both local backups and Xen Projects is considered best practice.
Automatic Version Management
To prevent projects growing indefinitely, Xen automatically keeps the latest 50 Project Versions for each saved project. Older versions are removed automatically as new versions are created, ensuring revision history remains useful without unnecessary database growth.
Best Practices
The simplest workflow is usually the most reliable.
Keep one trading tool per project, update projects regularly, and test every significant change inside cTrader before continuing development. Whenever you reach a stable milestone, update the project so Xen records another Project Version. This gives you a reliable point to return to if future changes do not produce the expected results.
Common Mistakes
Most problems occur because of workflow rather than coding.
Avoid working on multiple trading tools inside the same project, forgetting to update projects after major changes, or relying only on temporary Session Snapshots. Maintaining a consistent workflow with Projects, Project Versions, and local backups provides the safest and most productive way to develop cTrader applications using Xen AI.