How to work around a name Lipi does not have
An absent name is a common reason a script will not compile, so rule it out early rather than late. Work in this order.
- Validate the script. The editor checks it without running it and reports each diagnostic with a start and an end position. Read the position, not only the message.
- Look the name up. The function index, variable index and constant index are generated from the language contract. If a name is not in them, a script cannot use it.
- Take the substitution from What Lipi does not do. That page lists the names that do not resolve and what Lipi has in their place. It is the one place the substitutions are maintained; do not work them out again here.
- If nothing substitutes, rewrite the calculation from names that do exist.
A worked substitution
^ is not an operator in Lipi, and a script containing one does not parse.
math.pow is how you raise a number to a power.
math.pow(series float base, series float exponent) → series floatindicator("Squared range", "sqrange", false)
plot(math.pow(high - low, 2), title = "Range squared", color = color.blue)Where the failure will reach you
It depends on what kind of absence it is.
| Kind of absence | When it bites |
|---|---|
punctuation or an operator the grammar does not reach, such as ^ or a semicolon separator | when the script is validated |
a keyword the grammar does not accept, such as a declaration opening var | when the script is validated |
| a name the contract does not publish | when the script is validated |
In all three cases the editor tells you before the script runs. A script that validates has been parsed, scoped and type-checked, but not run — so a clean validation is not a promise about runtime.
See What Lipi does not do, Common questions and The Lipi editor.
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.