> ## Documentation Index
> Fetch the complete documentation index at: https://gocharting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to work around a name Lipi does not have

> The names other languages have that Lipi v2 does not, the compiler's message for each, and what to write instead.

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](https://gocharting.com/docs/scripting/reference/functions/global.md), 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)`:

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Squared range", overlay=false)
plot(math.pow(high - low, 2), title="Range squared")
```

Written with `^`, the script is refused at parse time:

```lipi-invalid theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Caret")
x = high - low
y = x ^ 2
plot(y)
```

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](https://gocharting.com/docs/scripting/language/names-and-conventions.md). The names with no equivalent (`request.security`, `matrix`, `map`,
`log.info`, `import`) are in [What Lipi does not do](https://gocharting.com/docs/scripting/getting-started/not-supported.md). Two more that are not there:

| You wrote | The compiler says | Write instead |
| - | - | - |
| `for i = 0 to 10 by 2` | `no viable alternative at input '\n}'` (reported at the end of the loop) | `for i = 0 to 10 step 2` |
| `strategy.risk.*` | Namespace `strategy` has no variable `risk`. | nothing |

## 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:

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Previous day's high and low", overlay=true)
static float dayHigh = na
static float dayLow = na
static float prevHigh = na
static float prevLow = na
if interval.change("1D") {
    prevHigh := dayHigh
    prevLow := dayLow
    dayHigh := high
    dayLow := low
} else {
    dayHigh := math.max(dayHigh, high)
    dayLow := math.min(dayLow, low)
}
plot(prevHigh, title="Previous day high")
plot(prevLow, title="Previous day low")
```

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](https://gocharting.com/docs/scripting/reference/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.