Indicator Editor

Edit PineTS indicators in one workspace.

Overview

PropertyValue
Keyeditor_indicator
CategoryEditor

The Indicator Editor is where you write and refine custom PineTS indicators. It provides a full Monaco code editor with TypeScript support, an inline cheat sheet for PineTS globals, and server-side verification so you can validate your script before saving. Use the Indicator List widget to browse and create indicators; the editor is the primary workspace for writing their logic.

Features

  • Monaco code editor with TypeScript syntax highlighting, autocomplete, and the PineTS type definitions loaded automatically.
  • Cheat sheet toolbar grouped by category (data, technical-analysis, input, plot, and more). Hover any symbol to see its signature, description, and usage examples.
  • Verify button runs the indicator server-side against mock data and reports the number of plots and markers produced, plus any warnings about unsupported styles or plot types.
  • Save button persists the PineTS code and automatically infers inputMeta from input.* calls in the script so the chart can render input controls.
  • Wand prompt bar lets you describe indicator logic in plain English and streams generated PineTS code directly into the editor.
  • Environment variable dropdown triggers when you type the {{ pattern, letting you reference workspace secrets inside indicator code.
  • Indicator selector in the header bar switches between indicators in the current workspace. When paired via a color link, the selector syncs with the Indicator List widget.

Usage

  1. Add the widget to a workspace from the widget picker.
  2. Select an existing indicator from the header dropdown, or create one in the Indicator List widget first.
  3. Write PineTS code in the editor. Use globals directly -- close, ta.sma, input.int, plot -- without a $ prefix.
  4. Click the Verify button (checkmark icon) to run a server-side dry run. Fix any errors or warnings that appear.
  5. Click the Save button to persist the indicator. The chart will pick up the updated code on next render.

Keyboard Shortcuts

  • Wand toggle: Click the wand icon in the editor gutter to open or close the AI prompt bar.

This widget supports the pairColor mechanism. Assign the same color to an Indicator Editor and an Indicator List widget so that selecting an indicator in the list automatically opens it in the editor.

Configuration

The widget has no user-facing configuration beyond the indicator selector. The selected indicator is stored in widget params as pineIndicatorId and synced through the pair-color store when linked.