Skip to content
Algo Trade Analytics Docs

Make and review a Pine Script change

Basic or Professional

Use this path for a small, reviewable change to an existing Pine strategy. You are done when the intended diff is accepted, the selected validator reports no errors, the tab is saved, and any behavioral claim has a separate Lab result.

You need:

  • a plan with AI Pine Editing access and available AI credits;
  • a writable strategy tab in Algo Lab; and
  • one change whose expected behavior you can describe.

If no strategy exists, use the empty-state action or + in the editor to create one. Rename the tab before material work so later runs and Case Study variants are identifiable.

  1. Open Algo Lab → Editor and select the strategy tab you intend to change.

  2. Save the baseline. Confirm the tab has no unsaved-change dot and the Save button is disabled before asking for a change.

  3. Open the Algo Agent drawer and choose Agent. Ask and Research are read-only with respect to the editor; they can explain or investigate but do not land a code edit.

  4. Describe the change and what must remain unchanged. For example:

    In the active Pine v6 strategy, turn the RSI length into an integer input
    named "RSI length" with a default of 14 and a minimum of 2. Preserve entry,
    exit, sizing, and webhook logic. Stage one minimal editor change.
  5. Supervise the turn. Review any tool activity, approval request, or question before continuing. Stop the Agent if it moves beyond the stated edit.

  6. Review the staged side-by-side diff. Choose Accept All only if every changed line belongs to the request; otherwise choose Reject All and ask for a narrower change.

  7. Keep Validation enabled. In Editor options, choose Internal engine or TradingView API, then read the compact validation panel below the code.

  8. Select Save. The unsaved dot should disappear and Save should become disabled. Use Copy if you need an external backup.

  9. Select Run with the same symbol, timeframe, date range, market data, and strategy settings used for the baseline.

The stages answer different questions:

StageWhat it establishes
Diff reviewThe proposed source change matches the requested scope.
ValidationThe selected validator found no blocking source error.
Lab runThe current engine produced results for the chosen data and settings.
TradingView checkTradingView accepted and ran the script in its own environment.

Preserve the baseline and candidate results in a Case Study when the change is part of a research decision. A better single run is not enough to promote a strategy without the required verification.

If the task adds webhook output, use the editor’s Webhook action. Review the staged payload change, then follow the Webhook Integration guide.