Script Editor

The Script Editor is where you write, save and manage your own indicators. A saved script appears in every chart's indicator list under My scripts.

Module
Script Editor
How to open
Add Widget ▸ Charting & Analysis ▸ Script Editor
Data source
Scripts are saved to your account
Saved in workspace
Yes
The Script Editor with the list of saved scripts on the left and a script open in the code editor (dark theme)
A script open in the editor.

The toolbar

ControlWhat it does
NewStart a new, untitled script.
RefreshReload your saved scripts from your account.
ExamplesLoad one of the built-in example scripts as a starting point.
Open script fileOpen a script from a file on your computer.

My scripts

The list on the left holds your saved scripts, each with its saved status and version. Click one to open it.

Editing

ControlWhat it does
Script nameThe name shown in the chart's indicator list.
Format sourceTidy the indentation and spacing of the code.
Download sourceSave the script as a file.
SaveSave the script to your account (Ctrl/⌘ S).
Save copySave under a new name, leaving the original unchanged.
DeleteRemove the script.

Below the editor:

  • Default inputs lists the inputs the script declares, with their defaults.
  • Import Pine draft converts a Pine Script draft into the editor as a starting point; review the result before saving.
  • Open saved version returns to the last saved copy.
  • Order-flow reference lists the order-flow series a script can read.

Using a script on a chart

  1. 1
    Save the script

    Scripts must be saved to your account before a chart can use them.

  2. 2
    Add it from the chart

    On a chart, open Indicators and choose it under My scripts.

  3. 3
    Set its inputs

    Each chart keeps its own input values, independent of the defaults in the editor.