The Lipi editor

You write and check scripts in the Lipi editor.

Checking is separate from running

The editor validates a script without running it. Validation and execution are two modes of the same interpreter, so a script that validates has been parsed, scoped and type-checked. It has not been executed against any bars.

Every problem carries a position

Each problem is reported with a start position and an end position. It marks a span of your source rather than pointing at a line, so you can see which part of a statement the interpreter objected to. Problems come back in two groups: errors and warnings.

editor marking a syntax error after compilation

A check also returns what your script resolved to

Validation does not return problems alone. It also returns the symbol table the script resolved to: its variables, its functions, its types, its enums and its scopes. So a check tells you not only what is wrong, but what the interpreter understood your script to contain.

editor showing a function's argument types on hover

What a clean check does not prove

A script that validates has not run. Some failures only happen during a run, and reading further back than the lookback limit is one of them: it fails while the script is running, not when the script is checked.

A script that checks cleanly looks like this:

indicator("Closing price")
plot(close)

editor reporting a lookback beyond the allowed range

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade