Skip to content
Algo Trade Analytics Docs

Validate Pine Script in Algo Lab

Basic or Professional

Algo Lab validates the active strategy automatically after editing settles. Open Editor options, enable Validation, and choose the provider that answers the question you are testing.

ProviderUse it forAccount requirement
Internal engineFast feedback from the Pine-compatible runtime used by Algo Lab research and backtests. This is the default.No TradingView username required.
TradingView APIAn external TradingView compiler check before moving the script to a chart.A TradingView username saved in Account Integrations.

The internal runtime is not a mirror of TradingView. Language coverage, data, session handling, and broker simulation can differ. A clean internal result means the selected Algo Lab validator found no blocking diagnostic; it does not guarantee that TradingView will compile or behave identically.

  1. Open Algo Lab → Editor and make the intended strategy tab active.

  2. Open Editor options, enable Validation, and select Internal engine or TradingView API.

  3. Edit the script. Validation runs automatically after a short pause and refreshes the diagnostics for the active source.

  4. Read the first relevant error before addressing later messages; one syntax failure can produce several downstream diagnostics.

  5. After a correction, wait for the next result, save the strategy, and run the relevant backtest again.

When TradingView API is selected, save a username under Account → Integrations → TradingView. The username identifies the validation request. It does not connect the account, import private libraries, or grant access to saved TradingView scripts.

Fix with AI sends a diagnostic and the current strategy context to the AI workflow. It requires an active chat and available AI credits. A proposed repair is staged for review; it is not silently merged.

  1. Select Fix with AI on the diagnostic.
  2. Review the explanation and every changed line.
  3. Accept or reject the full proposal.
  4. Validate again, save, and rerun the same research scope.

If a repair changes trading behavior beyond the diagnostic, reject it and ask Agent mode for a smaller change.

  • Confirm Validation is enabled and the active strategy is not empty.

  • For TradingView API, confirm a non-empty username is saved.

  • Switch to Internal engine to distinguish a TradingView request problem from a source-level diagnostic.

  • Preserve the exact message and retry once after checking connectivity.

  • If the providers disagree, treat the TradingView chart and Strategy Tester as the final evidence for TradingView behavior and record the difference.

  • Compare the engines

  • Review staged changes

  • Troubleshoot AI Pine editing