Scripts
Read, author and validate indicator scripts.
04d191a). Descriptions are the exact text the model receives.script_reference_query
Read the indicator script reference before writing or changing a script. topic="guide" is the authoring guide: skeleton, series semantics, inputs, cross-bar state and common errors. Other topics list signatures, options and enum values.
Parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
topic | enum | Yes | one of "guide", "runtime", "plot", "drawing", "ta", "enums" | Reference topic id. |
Minimal input · Required fields only; placeholders are derived from the schema.
{
"topic": "guide"
}JSON Schema
…scripts_read
List or read user indicator scripts. Without scriptId it returns { scripts: [{ id, name }], folders: [{ path }] }. With scriptId it returns { script: { id, name, source } }. Built-in scripts and user libraries are not listed. Read the exact source before scripts_write update; never reconstruct a script from memory.
Parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
scriptId | string | — | min length 1 | Script id from scripts_read. Omit to list every user indicator script and the writable folders. |
Minimal input · Required fields only; placeholders are derived from the schema.
{}JSON Schema
…scripts_write
Create, update or delete a user indicator script. create: source plus an optional folder from scripts_read; the source is compiled and registered immediately, so a compile error is returned verbatim. update: scriptId plus the COMPLETE source; partial patches are not supported, so call scripts_read first. delete: scriptId; the chart instances of that script are removed with it. The source is the single source of truth: it must declare defineIndicator, the current indicator API version (version: 2), its name and position. Only indicator scripts are accepted; defineLibrary is rejected. A created script is registered but not added to the chart; call indicators_write add with its name afterwards.
Parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
action | enum | Yes | one of "create", "update", "delete" | |
scriptId | string | — | min length 1 | update and delete: id returned by scripts_read. |
folder | string | — | — | create only: folder path from scripts_read. Omit to place the script at the indicator root. |
source | string | — | min length 1 | create and update: the COMPLETE script source, including defineIndicator and the indicator API version. |
Minimal input · Required fields only; placeholders are derived from the schema.
{
"action": "create"
}JSON Schema
…