Skip to content

Build a cTrader Indicator with Xen AI

What this Workflow Does

The Build a Technical Indicator workflow helps you create a custom trading indicator from scratch. It is designed for users who want to define their own logic, inputs, calculations, and chart output.

This workflow focuses on clarity, structure, and correctness. The goal is to create a clean baseline indicator first, then test and extend it gradually.

Xen AI – Build Custom Indicators Demo

Watch this video to learn how to create a custom indicator using Xen AI for cTrader, even if you have no coding experience. The demonstration shows how Xen AI helps define the visual display, add alerts, and generate clean, compile-ready C# code.

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

When to Use This Workflow

Use this workflow when you want to create a new indicator and already have a clear idea of what it should measure or display. This may include a formula, a market condition, a visual signal, or a custom calculation.

This workflow is not intended for trade execution. If you want the tool to open, close, or manage trades automatically, use Build a Trading Robot instead.

What You Should Prepare

Before starting, define the purpose of the indicator in plain language. Xen needs to understand what the indicator measures, which inputs are required, and how the result should appear on the chart.

Useful details include:

  • calculation rules or formulas
  • input periods and thresholds
  • chart output, such as lines, histograms, arrows, or colours
  • whether values should update per tick or per bar

Start with the minimum viable version. Once the baseline compiles and displays correctly, additional features can be added safely.

How to Interact with Xen

Describe the indicator in functional terms rather than platform-specific syntax. Explain what the indicator should calculate, what should be configurable, and how the output should be shown.

Good examples:

  • “Create an indicator that calculates a moving average.”
  • “Plot two lines and highlight crossovers.”
  • “Add configurable input periods.”
  • “Update values once per bar.”

Avoid vague requests such as:

  • “Make a complex indicator.”
  • “Copy an existing one.”
  • “Add everything at once.”

Specific instructions produce cleaner code and more reliable results.

How Xen Builds Indicators

Xen will generate a clean baseline indicator structure with inputs, calculations, and visuals separated where possible. It follows the correct indicator lifecycle rules for the target platform and returns a complete, compile-ready file.

The first version should be treated as a baseline. Compile it, test the output, and confirm the values behave as expected before requesting further changes.

Common Mistakes to Avoid

Most problems occur when too much is requested in the first build. Avoid combining multiple features, alerts, and visual elements before the baseline has been tested.

You should also avoid mixing indicator logic with trade execution. Indicators are designed to calculate and display information, not to manage trades.

A simple build, test, and extend approach produces the most reliable results.

After building the indicator, compile and test it thoroughly. Confirm that values match expectations and that visual output behaves correctly across different symbols and timeframes.

Once the baseline is stable, you can add alerts, extra visuals, or more advanced settings.