Work on an Existing Indicator
Use Existing Indicator when you already have a complete Pine Script indicator and want Xen to review it, fix a problem or make a focused change. This workflow keeps source files separate from the conversation, so clarification answers and later requests continue to use the same authoritative indicator.
Working on an existing indicator with AI
Start with the current indicator
Select Existing Indicator, then Add source code. Paste the complete Pine Script or select Load a .pine file, enter a file name and select Add source. The first file is always saved as the Current codebase and must contain an indicator() declaration.
Do not paste the indicator into the ordinary message box. If you do, Xen redirects the complete script to the source window so it can be stored correctly. Use the message box for your request after the source has been added.
Choose how each source file is used
An Existing Indicator project can retain up to four source files. Each file has one of three roles:
- Current codebase is the complete indicator Xen must review or modify. There can be only one current codebase.
- Merge functionality into the current codebase supplies another script whose relevant features should be integrated into the current indicator.
- Use only as example code gives Xen a pattern or implementation to study without treating every feature as a merge requirement.
After a current indicator has been saved, reopen Add source code to add merge or example files. Choose Replace current codebase when a newer complete indicator should become authoritative. Attached files and their roles appear above the message box and can be removed if they are no longer relevant.
When sharing merge or example code, explain exactly which calculation, plot, alert or visual behaviour Xen should reuse. A source role provides context, but it does not replace a clear request.
Request one focused change
Describe what happens now, what should happen instead and what must remain unchanged. For indicator changes, identify the calculation, inputs, plots, colours, line styles, labels, alert conditions, panel placement and higher-timeframe behaviour that must be preserved.
You can also attach a chart image to show the intended appearance. Treat it as visual context and describe the calculation in writing because an image cannot reveal the exact formula. When reporting a problem, include the symbol, timeframe, relevant inputs, bar state and whether it appears historically, in real time or only in alerts. If you add source without a request, Xen identifies the indicator and asks what you want to do instead of rewriting it automatically.
Review without modifying the indicator
Select Review indicator beside the attached files to request a static review of all shared source. Xen reports priority findings, current behaviour, questions and recommended next steps without generating replacement code. Pine Editor remains authoritative for compilation and runtime behaviour.
For a narrower analysis, ask a direct question in the message box and state that you do not want code changed.
Test every revised version
When Xen returns a complete revised indicator, that version becomes the latest working source for the project. Paste it into Pine Editor, resolve every compiler message, then compare plots, values and alerts using the same symbol, timeframe and inputs. Check historical and real-time bars and review higher-timeframe requests for repainting before requesting the next change.