Skip to content

Working with Xen AI Snapshots

What Snapshots Are

Xen AI snapshots allow you to save a point-in-time version of a project. They act as restore points, preserving your code and project state exactly as it existed when the snapshot was created. A snapshot differs from a normal project save. When you save a project, Xen updates the current working version. When you create a snapshot, Xen preserves a separate historical version that can be restored later without affecting future development.

This gives you the freedom to experiment with new ideas, test alternative approaches, and make significant changes while knowing that a stable version remains available if you need it.

Xen AI – Snapshot Overview Demo

Watch this video for a quick understanding of Xen’s snapshot feature.

Tip: Set the video quality to HD (1080p) for the best viewing experience.

Projects and Snapshots

Projects and snapshots work together but serve different purposes. A project contains the current working version of your cBot, indicator, or trading tool. Each time you save the project, Xen updates that version with your latest changes.

A snapshot is a historical copy of the project at a specific moment in time. You can create multiple snapshots within the same project and restore any of them later if required. A simple way to think about it is that the project represents where you are now, while snapshots represent important milestones from the past.

Why Snapshots Matter

Trading tools often evolve through many stages of development. A simple idea can quickly grow into a complex project involving multiple features, optimisation cycles, and testing sessions. As development progresses, changes do not always produce the expected results. A new feature may introduce errors, an optimisation may reduce performance, or a previously stable strategy may stop behaving as intended.

Snapshots provide a safety net throughout this process. Instead of worrying about losing a working version, you can create a snapshot before making major changes and return to it at any time if required. This makes development safer, more organised, and significantly easier to manage over longer projects.

When to Create a Snapshot

A good habit is to create snapshots whenever you reach a meaningful milestone in development. This ensures that important versions remain available even as the project continues to evolve. Many developers create snapshots after generating a working tool, fixing a difficult issue, completing a new feature, or successfully testing the strategy in cTrader. Others create snapshots before making major changes so they always have a version they can return to if the new work introduces problems.

The exact timing is not important. What matters is creating snapshots regularly enough that you never risk losing a stable and tested version of your work.

Creating a Snapshot

Creating a snapshot stores the current state of the project separately from future changes. Once created, the snapshot remains unchanged regardless of how the project develops afterwards. It is recommended to use clear and descriptive names when creating snapshots. Good names make it much easier to identify important milestones later, particularly when working on large projects over an extended period.

Examples of useful snapshot names include:

  • Initial Working Version
  • Added Risk Management
  • Fixed Trade Execution
  • Optimised Entry Logic
  • Release Candidate

A well-named snapshot can save significant time when reviewing or restoring previous versions.

Restoring a Snapshot

If a project becomes unstable or changes do not work as expected, you can restore a previous snapshot and continue development from that point. Restoring a snapshot loads the saved version back into the project, giving you immediate access to a known working state. This is often faster and safer than attempting to manually undo large numbers of changes.

Many developers use snapshots as a safety mechanism before introducing major features or structural code changes. If the new implementation fails, the previous version can be restored within seconds.

Snapshots vs Project Saves

It is important to understand the difference between saving a project and creating a snapshot. Saving a project updates the current working version. Each save replaces the previous version and ensures Xen has access to the latest code and project information. Creating a snapshot does not replace anything. Instead, it preserves a separate copy of the project that remains available for future restoration.

Think of a project save as updating a document you are currently editing. A snapshot is more like creating a permanent checkpoint that can be revisited at any time.

The safest workflow combines both project saves and snapshots. A typical development cycle begins by creating or loading a project and generating the initial code. As development progresses, save the project regularly to ensure Xen always has access to the latest version.

Before making significant changes, create a snapshot. This provides a safe rollback point if the new work introduces unexpected issues. After making changes, test the code in cTrader and continue refining the project. By repeating this process throughout development, you maintain both flexibility and protection.

Working with cBots

cBots often require multiple rounds of testing and refinement before they are ready for live trading. Entry conditions, exit logic, risk management, and trade execution behaviour may all change throughout the development process.

Snapshots provide an effective way to preserve successful versions before introducing new functionality. Many developers create snapshots after successful compilation, profitable backtests, or major strategy improvements. This creates a clear history of development and reduces the risk of losing valuable work.

Working with Indicators

Indicators frequently evolve as calculations, visual elements, signals, and alerts are refined. Small changes can sometimes have a significant impact on behaviour and performance. By creating snapshots at important milestones, you can preserve versions that are known to display correctly, generate reliable signals, and perform efficiently.

If later modifications introduce problems, restoring a previous snapshot allows development to continue without unnecessary delays.

Avoiding Version Confusion

One of the most common development issues is losing track of which version of the code is currently being tested or deployed. Snapshots help eliminate this problem by creating clear reference points throughout the life of a project. Each snapshot represents a specific stage of development and can be restored whenever needed. Combining meaningful snapshot names with regular project saves makes it much easier to maintain a clear and organised workflow.

Best Practices

The most effective approach is to create snapshots at meaningful milestones rather than after every small change. Save your project regularly, create snapshots before major updates, and test your code thoroughly in cTrader before marking a version as an important milestone.

It is also recommended to maintain local backups of important projects. While snapshots provide excellent protection within Xen, independent backups offer an additional layer of security. A disciplined workflow makes snapshot management simple and highly effective.

Common Mistakes to Avoid

Most snapshot-related problems result from inconsistent workflows rather than technical issues. Common mistakes include creating snapshots too infrequently, using unclear names, relying solely on project saves, deleting important snapshots prematurely, or creating snapshots before testing the code. By following a consistent workflow and treating snapshots as development milestones, you can avoid most of these issues.

Summary

Snapshots provide an additional layer of protection when developing cTrader cBots and indicators in Xen AI. While projects store your current working version, snapshots preserve important milestones that can be restored at any time.

By creating snapshots before major changes and after successful testing, you can experiment more freely while maintaining access to stable versions of your code. Combined with regular project saves and local backups, snapshots form an important part of a reliable development workflow.