Skip to content

Work on an Existing Indicator

What this Workflow Does

The Work on Existing Indicator workflow allows you to modify, extend, or fix an already built indicator.

It is designed to help you:

  • Adjust or refine existing calculations
  • Add new plots, signals, or conditions
  • Fix errors or incorrect behaviour
  • Safely evolve an indicator step by step

This workflow prioritises clarity and stability over adding excessive features.


When to Use This Workflow

Use this workflow when:

  • You already have an indicator
  • You want to modify or improve its behaviour
  • You need to fix calculation or plotting issues
  • You want to extend functionality incrementally

Do not use this workflow to build a new indicator from scratch.
Use Build a Technical Indicator instead.


What You Should Prepare

Before starting, provide:

  1. Existing source code
    The full indicator file you want to modify.

  2. Clear objective
    What you want to change or improve.

  3. Specific calculation or behaviour
    Exact formulas, conditions, or outputs to add or adjust.

  4. Constraints (optional)
    Performance limits, display preferences, or parameter requirements.

Be precise. Indicators depend on clearly defined calculations.


How to Interact with Xen

Focus on one change at a time.

Good examples:

  • “Add a signal when RSI crosses above 70.”
  • “Smooth the output using an EMA.”
  • “Plot a second line with a different period.”
  • “Fix repainting on the current candle.”

Avoid:

  • “Make it better”
  • “Improve accuracy”
  • “Add everything including alerts, filters, and dashboards”

Small, controlled changes produce reliable indicators.


How Xen Modifies Existing Indicators

Xen will:

  • Analyse the current calculation and structure
  • Modify only the required sections
  • Preserve existing plots and behaviour where possible
  • Keep calculations separated and readable
  • Return a complete, compile-ready file after each change

Clear instructions ensure accurate modifications.


Common Mistakes to Avoid

  • Providing incomplete code
  • Mixing multiple changes in one request
  • Not defining calculation changes precisely
  • Breaking existing plots or buffers unintentionally
  • Editing code manually without informing Xen

Always validate each change before continuing.


After each modification:

  • Compile and confirm no errors
  • Apply the indicator to a chart
  • Verify plots, signals, and values behave as expected

Then extend gradually with:

  • additional signals
  • smoothing or filtering
  • alerts and notifications
  • visual improvements

You may also want to explore: