Skip to content
Algo Trade Analytics Docs

Editor Workspace

Basic & Pro Plans

The Editor Workspace is the left panel of the Pine Script AI Editor. It provides a professional code editing environment with multi-tab support, syntax highlighting, and automatic saving.


β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ [Tab 1] [Tab 2] [Tab 3] [+] β”‚ ← Tab Bar
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ //@version=6 β”‚
β”‚ strategy("My Strategy", overlay=true) β”‚ ← Code Editor
β”‚ ... β”‚
β”‚ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Errors (0) Warnings (0) βœ“ Valid β”‚ ← Validation Status
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Click the + button in the tab bar to create a new script tab.

Tab types:

  • Strategy β€” For full trading strategies with entries/exits
  • Library β€” For reusable Pine Script libraries

Click any tab to switch to it. Your code and cursor position are preserved.

Double-click a tab name to rename it. Press Enter to confirm or Escape to cancel.

Hover over a tab and click the Γ— button to close it.

Warning: If you have unsaved changes, you’ll be prompted to save first.

IndicatorMeaning
● (dot)Unsaved changes
βœ“ (check)All changes saved

The editor provides Pine Script-specific syntax highlighting:

  • Keywords β€” strategy, indicator, if, for, etc.
  • Built-in Functions β€” ta.rsi(), ta.ema(), strategy.entry(), etc.
  • Numbers β€” Literal values and constants
  • Strings β€” Text in quotes
  • Comments β€” Lines starting with //

The editor automatically indents your code as you type:

  • After if, for, while statements
  • Inside function definitions
  • Following line continuations

When enabled, the editor suggests:

  • Pine Script built-in functions
  • Variable names from your code
  • Common parameter names

Toggle autocomplete in the toolbar settings menu.

Line numbers appear on the left side of the editor. These are essential for:

  • Debugging error messages
  • Referencing specific code sections
  • Communicating with the AI about line-specific issues

The toolbar above the editor provides quick access to common actions:

IconActionShortcut
πŸ’ΎSaveCtrl/Cmd + S
πŸ“‹Copy CodeCtrl/Cmd + C (all)
πŸ“₯Download as .pineβ€”
βœ“ValidateCtrl/Cmd + Shift + V
βš™οΈSettingsβ€”

Access the settings gear icon to toggle:

  • Autocomplete β€” Enable/disable code suggestions
  • Auto-Validation β€” Automatically validate after changes
  • Auto-Save β€” Save changes after 2 seconds of inactivity

ShortcutAction
Ctrl/Cmd + ZUndo
Ctrl/Cmd + Shift + ZRedo
Ctrl/Cmd + CCopy selection
Ctrl/Cmd + XCut selection
Ctrl/Cmd + VPaste
Ctrl/Cmd + ASelect all
Ctrl/Cmd + DDuplicate line
ShortcutAction
Ctrl/Cmd + GGo to line
Ctrl/Cmd + FFind
Ctrl/Cmd + HFind and replace
Ctrl/Cmd + HomeGo to start
Ctrl/Cmd + EndGo to end
ShortcutAction
Alt + ClickAdd cursor
Ctrl/Cmd + Alt + Up/DownAdd cursor above/below
Ctrl/Cmd + Shift + LSelect all occurrences

When enabled, auto-save works as follows:

  1. You make a change to your code
  2. After 2 seconds of no typing, the change is saved
  3. The tab indicator updates from ● to βœ“

Benefits:

  • Never lose work due to browser crashes
  • Changes persist across sessions
  • No manual save required

When to disable:

  • Working on experimental changes you might want to discard
  • Making rapid iterations you don’t want saved individually

The editor maintains a full history of your changes:

  • Undo β€” Reverts the last change (Ctrl/Cmd + Z)
  • Redo β€” Re-applies an undone change (Ctrl/Cmd + Shift + Z)

History is preserved:

  • Within a session (until you close the browser)
  • Across tab switches
  • After applying AI suggestions

  1. Select code in the editor
  2. Click Share Selection in the chat panel
  3. The selected code is attached to your next message

Use cases:

  • β€œWhat does this function do?” (with function selected)
  • β€œRefactor this section” (with code block selected)
  • β€œIs there a bug here?” (with suspicious code selected)

When you have code selected:

  • The status bar shows the selection line range
  • The β€œShare Selection” button becomes active
  • Selected code is highlighted in the editor

Below the editor, the validation panel shows:

βœ“ Script is valid | No errors or warnings detected
❌ 2 Errors | ⚠️ 1 Warning
Line 15: Undeclared identifier 'rsi_value' [Fix with AI]
Line 23: Using deprecated function 'security' [Fix with AI]

Click Fix with AI to automatically send the error to the AI for resolution.


  • Keep one β€œmain” version and create copies for experiments
  • Name versions clearly (v1, v2, β€œwith stops”, etc.)
  • Delete unused tabs to reduce clutter
// === ENTRY CONDITIONS ===
longCondition = ta.crossover(rsi, 30)
// === EXIT CONDITIONS ===
exitCondition = ta.crossover(rsi, 70)

Comments help you and the AI understand your code structure.

Even with auto-save, manually save before:

  • Applying large AI suggestions
  • Making significant refactors
  • Testing experimental changes