Skip to main content
A name that does not exist is refused by the editor’s check, before the script runs, with the position of the name. Work in this order: read the message, look the name up in the reference, then take the replacement from the table below. If nothing replaces it, write the calculation from names that do exist.

Example: ^

^ is not an operator. Use math.pow(base, exponent):
Written with ^, the script is refused at parse time:
The compiler says: extraneous input '^' expecting {<EOF>, NEWLINE}.

Where the other names are

The habits that have a Lipi spelling (array.size, timeframe.*, plot.style_*, chart.point, color.pink, str.format, ^) are in Names and conventions. The names with no equivalent (request.security, matrix, map, log.info, import) are in What Lipi does not do. Two more that are not there:

Yesterday’s high without request.security

A script cannot read another interval, but it can build the previous day’s high and low from the chart’s own bars. interval.change("1D") is true on the first bar of each day, so keep a running day high and low, and copy them to “previous” variables when the day changes:
The same pattern builds any value over a longer period from a shorter chart, such as the week with interval.change("1W"). It works on a chart of an interval shorter than the period; on a daily chart “the previous day” is the previous bar. See also Compiler messages.