Script structure
Statements are separated by semicolons. Whitespace and line breaks are free. Identifiers and function names are case-insensitive — the scanner upper-cases them — but string literals keep their exact case.
| Form | Meaning |
|---|---|
NAME: expression; | Output. The series is drawn and NAME appears in the pane title and legend. |
NAME := expression; | Intermediate variable. Computed and reusable, but never drawn and never shown in the legend. |
FUNC(...); | A bare draw call such as STICKLINE or DRAWICON. It paints directly and produces no named output. |
NAME: expression, COLORRED, LINETHICK2; | Style modifiers follow the expression, separated by commas. See “Style modifiers”. |
{ ... } | Block comment. Can span lines. |
// ... | Line comment, to end of line. |
A statement whose value you want on screen uses a single colon. Everything else should use := so the legend stays readable — a script with fifteen outputs is unusable in practice.
TYP := (HIGH + LOW + CLOSE) / 3; // helper, not drawn
CCI: (TYP - MA(TYP, 14)) / (0.015 * AVEDEV(TYP, 14)); // drawn