Start by writing your trading rules
You do not need to know Pine Script to write a useful request; explain what the strategy or indicator should observe, which event should trigger a change and what should happen next.
Use familiar trading terminology where it is precise because Xen understands standard indicators such as EMA, RSI and ATR, while a custom calculation will need its formula, price source, period and smoothing method explained.
Build an RSI strategy.
Create a Pine Script v6 strategy that enters long when RSI(14) crosses above 30 and enters short when it crosses below 70, confirming signals at bar close, allowing one open position and providing configurable stop-loss and profit-target percentages.
For a strategy, define the entry and exit conditions, permitted trade directions, position sizing and required risk controls, mentioning sessions, pyramiding, higher-timeframe data and bar-close confirmation where they affect the trades.
For an indicator, explain the calculation and presentation separately by stating whether it overlays the chart or uses a separate pane, then describing its plots, colours, markers, levels and alerts.
There is no benefit in adding technical API names simply to make a prompt sound advanced because an accurate description of the behaviour is more useful than guessed Pine Script syntax.
Prompt examples
Trading strategy
Build a Pine Script v6 strategy using a 20 and 50 EMA crossover, entering long only when RSI is above 55 and short only when RSI is below 45. Confirm entries at bar close, disable pyramiding, use configurable ATR stop-loss and profit-target multipliers and show both EMAs on the chart.
Trading indicator
Create a Pine Script v6 overlay indicator that plots the previous day's high and low, keeping each level fixed for the current trading day and providing configurable colours, line widths and alerts when price crosses either level.
Indicator from an image
Use the attached chart as a visual reference and create a new indicator with a similar trend ribbon and reversal markers. Calculate the ribbon from the 20 and 50 EMA, confirm markers at bar close and provide configurable colours and alerts.
An image can communicate appearance but cannot reveal another indicator's formula, so always describe the calculations Xen should use.
Modify existing Pine Script
Add a configurable trading session from 09:30 to 16:00 to the attached strategy and prevent new entries outside it, without changing the existing entry, exit, position-sizing or alert logic. Return the complete updated Pine Script.
Let Prompt Builder clarify the project
When a strategy or indicator request is too broad to implement accurately, Xen's Prompt Builder reviews the idea instead of immediately generating code and guessing the missing behaviour, then asks up to three focused questions about decisions that would materially change the result.
These questions can cover entry timing, trade direction, exits, position management, bar-close confirmation, visual output or higher-timeframe behaviour, leaving you as the trader in control of the design.
Prompt Builder uses the clarified requirements to create an ordered Build Plan in which each stage contains a focused prompt to feed into Xen, beginning with a working baseline before adding and testing further features against the existing source.
Stage 1 builds the core entry and exit logic, Stage 2 adds configurable risk management and Stage 3 adds the trading session and alerts, with the complete Pine Script compiled and tested after each prompt before work continues.
Working this way keeps each change understandable and testable while reducing the chance that one large request produces code containing several unverified assumptions.
Report exact results after testing
If Pine Editor reports an error, provide the exact diagnostic and the latest complete source; if the code compiles but behaves incorrectly, explain what happened, what you expected and which symbol, timeframe and settings were used.
Keep repair work separate from unrelated enhancements until the original issue is resolved because “the strategy does not work” gives Xen very little evidence, whereas a specific unexpected entry or missing plot gives it something concrete to investigate.
Choose the right Xen workflow
Use Build Strategy when starting a new automated strategy and Build Indicator for a new visual study, signal tool or dashboard, while projects that already have complete source should use the matching Existing task so the authoritative code remains separate from the conversation.