Zeal TerminalOpen the chart
Zeal Terminal / Guides

How to ask the AI assistant: explain results and edit code

Updated 26 November 2026

The AI assistant can explain a script, write or fix Pine code, and explain how a strategy performed. It works with what you are looking at: the chart, the script in the editor and the strategy report. It writes code straight into the editor, and you decide whether to keep it.

Try it in Zeal Terminal

Steps

  1. Code editor. Put a strategy in the editor so there are results to explain.
  2. Add to chart. Click Add to chart to run it.
  3. Code editor. Select code and click Edit with AI above it, or press Cmd+I (Ctrl+I on Windows and Linux), to ask for an edit in place.
  4. Explain results. Explain results, in the Strategy Tester, asks the assistant why the strategy performed as it did.
  5. AI assistant. Click AI assistant on the rail to open it. Click again to close it.
  6. AI assistant window. Sign in and turn it on once, then ask a question or pick a starter.

Editing in place with Cmd+I

A small box opens under the line. Type what you want and the proposed change is shown under your code with new lines in green and replaced lines struck through. Choose Accept (Alt+Enter), Reject (Escape) or Regenerate. Accept is a single edit, so Cmd+Z or Ctrl+Z undoes it.

Live edits from the chat

When a reply contains a Pine script, it is written into the editor as it arrives. The editor is read-only while this happens and a banner says "AI is editing", with a Stop button. When it finishes the editor stays locked while you review: each change gets a box above it with the old lines in red, and Accept and Reject buttons, and a bar under the code reads how many places changed, with Reject all and Accept all (Alt+Enter). Rejecting a change puts its old lines back. Once you have accepted something the script is recompiled; reject everything and your original code is back.

Explanations as diagrams

Explain in the editor header (or the Explain this script starter) draws a map of the script: settings, calculations, conditions and outputs, with a short note on the important ones. Hover a box to follow its chain, click it to jump to its line. Explain results in the Strategy Tester sends at once and answers with a card: equity against buy and hold, the drawdown, key figures, trade results, monthly returns and ideas to try. The app draws every number from your backtest.

What is sent

Every question carries the chart, your script, its errors and a summary of the strategy test. The assistant asks for more only when it needs it: your logs, the trade list, your drawings, the controls on screen or a picture of the app. A line under each answer says what was used. The screen icon in the question box sends a picture with your next question, though the assistant also asks for one itself. Past chats are kept in this browser: the clock icon in the panel header lists them. The panel shows how many requests are left this month.

Frequently asked questions

Can the assistant show me where something is? Yes. Ask how to do something and it can point at the control on screen.

Is my code private? Your question and the details the assistant needs are sent to write an answer. Past chats stay in this browser and are not uploaded.

Related guides

  • How to fix compile errors in the Pine editor
  • How to backtest a Pine Script strategy and read the results
  • Keyboard shortcuts for drawing and the editor

This guide is replayed by an automated test on every release, so the steps here match the app as it is today.

PricingContactRefundsPrivacyTermsCookiesDisclaimer

© 2026 Zeal Terminal. An independent project, not affiliated with TradingView, Inc.