How to Build an Indicator
What this Workflow Does
The Build a Technical Indicator workflow guides you through creating a custom trading indicator from scratch.
It is designed to help you:
- Define indicator inputs and parameters
- Implement calculation logic correctly
- Produce visual outputs on a chart
- Follow platform best practices for indicators
This workflow focuses on clarity, structure, and correctness, not speed.
Xen AI – Build Custom Indicators Demo
Watch this video to learn how to create a custom indicator using Xen AI for cTrader with no coding experience required. This demonstration shows how Xen AI helps you define visual display, and apply alerts, and generate clean, compile ready C# code.
Tip: Set the video quality to HD (1080p) in the player settings for the best viewing experience.
When to Use This Workflow
Use this workflow when:
- You want to create a new indicator
- You have a clear calculation or idea to implement
- You need clean, maintainable indicator code
- You want a safe baseline before adding complexity
Do not use this workflow to automate trades. For execution logic, use Build a Trading Robot instead.
What You Should Prepare
Before starting, make sure you have:
- A clear description of what the indicator measures
- Any formulas or logic involved
- Required inputs, periods, or thresholds
- How the indicator should be displayed
Start with the minimum viable version of the indicator.
How to Interact with Xen
Describe the indicator in functional terms, not platform specific syntax.
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 logic produces correct output.
How Xen Builds Indicators
Xen will:
- Generate a clean baseline indicator structure
- Separate inputs, calculations, and visuals
- Follow correct indicator lifecycle rules
- Add parameters for configuration
- Return a complete, compile-ready file
Xen assumes the first version is a baseline and expects you to test it before extending.
Common Mistakes to Avoid
- Requesting too many features in the first build
- Skipping compilation and testing
- Mixing indicator logic with trade execution
- Modifying code manually without informing Xen
Build, test, then extend.
Recommended Next Steps
After building the indicator:
- Compile and test it thoroughly
- Confirm values match expectations
- Extend visuals or add alerts incrementally
You may also want to explore: