AI INDICATOR GUIDE

Give your AI the TradeSetupPRO indicator guide

Use this page as reference when you ask an AI to write an indicator. It does not automatically train or change an AI model.

How to use this guide with an AI

  1. 01

    Share this page

    If your AI can browse, give it this page URL. Or copy the starter prompt below.

  2. 02

    Attach the full API brief from the app

    In TradeSetupPRO, open My scripts and choose Copy AI prompt. It includes the API, available helpers and worked examples.

  3. 03

    Describe the rules precisely

    State the formula, adjustable inputs, whether it belongs on price or in a separate pane, colours and signal conditions.

  4. 04

    Compile the returned code

    Paste the complete JavaScript file into the editor and choose Save & compile. If it reports an error, use Fix with AI to send the error and code back.

Rules the AI must follow

TradeSetupPRO indicators use the app’s JavaScript API. They do not use TradingView Pine Script.

File shape

Declare const definition and a top-level function calc(ctx, p, { ta }). Return an array of supported shapes.

Bar data

ctx provides candles, source and time. Each candle has time, open, high, low, close and volume.

Drawing output

Use supported shapes such as line, histogram, band, vspan, hline, vline, marker, label, hprofile and barcolor.

Runtime

Code runs in a sandboxed worker without DOM, window, network, storage or timers. Keep calculations efficient over large histories.

Check the result

A successful compile only means the code passed the compiler. Check plotted lines and signals against known values or reference conditions on the chart.

Before porting from TradingView: what maps

Pine Script cannot be pasted into this app as-is. The AI must rewrite its logic in JavaScript using the attached API brief, report anything that cannot map directly, and never silently drop a feature.

Supported app shapes

Lines and series use line or histogram; filled areas use band; background shading uses vspan; horizontal levels use hline; signals use marker or label; candle recolouring uses barcolor. Return these as shapes described by the API brief.

Needs a rewrite or adaptation

Pine syntax and ta.* calls must be rewritten in JavaScript with only the helpers listed in the API brief. If a formula has no helper, implement it and explain the calculation. The app builds Style controls from returned shapes, so give each output a clear title.

No direct TradingView equivalent

A dashboard/table pinned to the screen, Pine Visibility rules, status-line/price-scale display options and some input types such as free-text or session inputs have no direct equivalent in the current API. State the limitation and offer an alternative before coding.

Multiple timeframes

Visibility rules that restrict where an indicator appears differ from requesting data from another timeframe. If the source uses request.security or other-timeframe data, state what the API brief supports before proceeding; do not invent an API.

For example, HMA, ATR and level lines may be rewritten, but a dashboard, proximity sensitivity or signal rule only survives the port if the AI actually implements it. Seeing lines on the chart or passing compilation does not prove the result matches the source.

COPY AND USE

Starter prompt

Attach the complete Pine Script (or screenshots/lists of every Inputs, Style and Visibility setting) and Copy AI prompt from the app. Require a feature mapping before code, and do not allow unsupported features to disappear silently.

When porting an existing indicator, include

  • The complete Pine Script, not screenshots alone
  • Screenshots or lists of every Inputs, Style and Visibility setting
  • The expected output and exact signal conditions
  • Whether the dashboard, alerts or multi-timeframe behaviour must be preserved

What to require from the AI

Before code: a feature-by-feature mapping to the app, including unsupported or uncertain items. After code: the complete JavaScript file, a summary of changes or omissions, and steps to check the chart output.

Port or write an indicator for TradeSetupPRO. Read https://tradesetuppro.com/features/ai-indicator-guide/ and follow the complete API brief I attach. Use the app's JavaScript API, not Pine Script, and do not invent APIs or helpers.

For a port, first provide a feature-by-feature mapping covering formulas/rules, inputs and defaults, outputs/plots, Style, pane, timeframe/visibility, dashboard/alerts, and limitations. Mark each item “supported”, “adapted”, or “unsupported by this API”. Do not silently omit items or guess rules. Ask me if source code or requirements are incomplete.

Then return the complete JavaScript file in one code block. It must declare const definition and function calc(ctx, p, { ta }), return supported shapes, and give each output a clear title. After the code, summarize changes/unsupported items and how to compare the chart output. Compilation alone does not prove the result matches the source.

My source code and requirements: