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

# Lipi types

> Reference for the 23 types of Lipi v2: array, bool, box, chartPoint and 19 more, each with its definition and an example.

> [!NOTE]
>
> Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Entries: 23

## `array` (type)

**Definition**

An ordered, resizable list of values of one type, written `array<type>`, as in `array<float>`. Create one with `array.new<type>(length)`, a typed constructor such as `array.new_float`, or `array.from`, and work with it through the `array` functions.

An array declared with `static` keeps its elements from one bar to the next; without `static` it is created again on every bar.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("array Example", overlay=true)
// The last 10 closes, kept across bars
static array<float> closes = array.new_float(0)
array.push(closes, close)
if array.length(closes) > 10 {
    array.shift(closes)
}
plot(array.avg(closes), title="10-Bar Average", color=color.blue)
```

## `bool` (type)

**Definition**

A true-or-false value. The two constants `true` and `false` are the literals for it.

Comparisons produce one, and the marker functions take one as their condition. No fields.

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Bool Keyword Example", overlay=true)
// Calculate 50-period simple moving average (SMA)
sma50 = talib.sma(close, 50)
// Declare a boolean variable using `bool` keyword
bool isAboveSMA = close > sma50
// Plot a signal dot when the condition is true
plotshape(isAboveSMA, location=location.belowbar, color=color.green, shape=shape.circle, size=size.small, title="Above SMA")
```

## `box` (type)

**Definition**

A rectangular drawing on the chart, defined by two corners. Use box.new to create boxes and box.set\_\* functions to change them.

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Box Type Example", overlay=true)
if barstate.islast {
    box.new(bar_index[10], high, bar_index, low, border_color=color.blue, bgcolor=color.new(color.blue, 0.8), textcolor=color.white)
}
```

## `chartPoint` (type)

**Definition**

A single position on the chart, described by three fields: time carries when, index carries which bar, and price carries where on the price scale.

All three fields are series, so a point built on one bar need not hold the same coordinates as one built on the next.

**Fields**

| Name | Type | Description |
| - | - | - |
| `time` | `series int` | The x-coordinate of the point, expressed as a UNIX time value, in milliseconds. |
| `index` | `series int` | The x-coordinate of the point, expressed as a bar index value. |
| `price` | `series float` | The y-coordinate of the point. |

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chartPoint Example", overlay=true)
if barstate.islast {
    chartPoint p1 = chartPoint.from_index(bar_index[20], low[20])
    chartPoint p2 = chartPoint.from_index(bar_index, high)
    line.new(p1, p2, color=color.blue, width=2)
}
```

## `color` (type)

**Definition**

A colour. You can write one directly as a hex literal — six digits for the colour, eight to carry alpha as well.

Seventeen named constants and seven functions in the `color` namespace give you the other ways to get one. No fields.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Color Keyword Example", overlay=true)
// Define custom colors using `color` keyword
color bullishColor = color.green
color bearishColor = color.red
color neutralColor = color.gray
// Check conditions
isBullish = close > open
isBearish = close < open
// Assign colors based on conditions
color barColor = isBullish ? bullishColor : isBearish ? bearishColor : neutralColor
// Apply color to bars
barcolor(barColor)
```

## `display` (type)

**Definition**

Controls where a plot or indicator output is visible in the UI (pane, price scale, status line, data window).

**Fields**

| Name | Type | Description |
| - | - | - |
| `none` | | Hide from all display locations. |
| `pane` | | Show only in the chart pane. |
| `data_window` | | Show only in the Data Window. |
| `price_scale` | | Show on the price scale. |
| `status_line` | | Show in the status line. |
| `all` | | Show in pane, price scale, status line, and data window. |

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("display example")
plot(close, display=display.all)
plot(open, display=display.none)
plot(high, display=display.price_scale + display.status_line)
```

## `float` (type)

**Definition**

A number with a fractional part, written `1.5`. It has no fields.

Most market data is float: the bar's prices, its volume and the averaged prices are all float series.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("float Example", overlay=true)
float midPoint = (high + low) / 2
plot(midPoint, title="Mid Point", color=color.blue)
```

## `font` (type)

**Definition**

Font family constants for text drawn on boxes, labels, and table cells.

Pass them to `text_font_family` on `box.new` and `label.new`, to `table.cell`, or to the matching `*.set_text_font_family` setter. The parameter type is `font`, not `string`.

**Fields**

| Name | Type | Description |
| - | - | - |
| `family_default` | | Default proportional font for drawing text. |
| `family_monospace` | | Fixed-width font for drawing text. |

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("font Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text="Mono", text_font_family=font.family_monospace, size=size.small)
}
```

## `hline` (type)

**Definition**

The value `hline` gives back once it has drawn a horizontal level.

It plays the same part as a plot value in the other `fill` form: two hline values shade the band between two levels. Mixing one with a plot is not accepted — the two forms of `fill` are separate. No fields.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("hline Example", overlay=true)
// Draw a horizontal line at 100
hline(100, title="Static Line", color=color.red, linewidth=2, style=hlineStyle.dotted)
```

## `hlineStyle` (type)

**Definition**

Three line styles for a horizontal level: `solid`, `dashed` and `dotted`.

The smallest of the sets, and the only one used by `hline`. It is not interchangeable with `plotStyle`.

**Fields**

| Name | Type | Description |
| - | - | - |
| `solid` | | A solid line (default). |
| `dashed` | | A dashed line. |
| `dotted` | | A dotted line. |

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("hlineStyle Example", overlay=false)
hline(70, title="Overbought", color=color.red, style=hlineStyle.dashed)
hline(50, title="Middle", color=color.gray, style=hlineStyle.dotted)
hline(30, title="Oversold", color=color.green, style=hlineStyle.solid)
plot(talib.rsi(close, 14), title="RSI", color=color.blue)
```

## `int` (type)

**Definition**

A whole number. One of the five data types the grammar names directly.

Written as a bare number: `14`. It has no fields.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Int Keyword Example", overlay=true)
// Declare an integer variable for moving average length
int maLength = 20
// Calculate the Simple Moving Average (SMA) using the integer variable
smaValue = talib.sma(close, maLength)
// Plot the moving average
plot(smaValue, title="20-period SMA", color=color.blue, linewidth=2)
```

## `label` (type)

**Definition**

A text marker anchored to a bar/price. Use label.new to create labels and label.set\_\* functions to change them.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Label Type Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text="High", color=color.green, style=label.style_label_down)
}
```

## `line` (type)

**Definition**

A line drawing between two chart points. Use line.new to create lines and line.set\_\* functions to change them.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Line Type Example", overlay=true)
if barstate.islast {
    line.new(bar_index[10], high[10], bar_index, high, color=color.red, width=2)
}
```

## `linefill` (type)

**Definition**

A colored fill between two line drawings. The fill follows the current geometry of those lines. Only one fill may exist for a given ordered pair of lines; a later linefill.new on the same pair replaces the previous fill.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Linefill Type Example", overlay=true)
if barstate.islast {
    l1 = line.new(bar_index[10], high[10], bar_index, high, color=color.green)
    l2 = line.new(bar_index[10], low[10], bar_index, low, color=color.red)
    linefill.new(l1, l2, color.new(color.blue, 0.7))
}
```

## `location` (type)

**Definition**

Five places a marker can sit: `abovebar`, `belowbar`, `top`, `bottom` and `absolute`.

The first two are relative to the bar; `top` and `bottom` are relative to the pane; `absolute` places the mark at a price. It is the `location` parameter of `plotshape` and `plotchar`, and `plotarrow` has no such parameter at all.

**Fields**

| Name | Type | Description |
| - | - | - |
| `abovebar` | | Places the element above the current bar. |
| `belowbar` | | Places the element below the current bar. |
| `top` | | Places the element at the top of the chart. |
| `bottom` | | Places the element at the bottom of the chart. |
| `absolute` | | Places the element at a specific price level. |

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("location Example", overlay=true)
plotshape(close > open, title="Up Bar", location=location.belowbar, shape=shape.triangleup, color=color.green)
plotshape(close < open, title="Down Bar", location=location.abovebar, shape=shape.triangledown, color=color.red)
```

## `plot` (type)

**Definition**

The value `plot` gives back once it has drawn a series.

Its use is to be passed on: hold it in a variable and hand two of them to `fill` to shade the band between the two plots. It exposes no fields of its own.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Multi Plot Example", overlay=false)
// Generate a sample sine wave
length = 50
sineWave = math.sin(bar_index * 2 * 3.1415 / length) * 50
// Plot the sine wave as a solid line
plot(sineWave, title="Sine Wave", color=color.blue, linewidth=2, style=plotStyle.line)
// Plot the absolute sine wave as a histogram
plot(math.abs(sineWave), title="Absolute Sine Wave", color=color.green, style=plotStyle.histogram)
// Plot a cross marker at every bar based on sine wave peaks
plot(sineWave > 40 ? sineWave : na, title="Peaks", color=color.orange, style=plotStyle.cross)
// Plot circles at troughs of the sine wave
plot(sineWave < -40 ? sineWave : na, title="Troughs", color=color.purple, style=plotStyle.scatter)
```

## `plotStyle` (type)

**Definition**

The fourteen ways `plot` can draw a series: `line`, `linebr`, `area`, `areabr`, `smoothedArea`, `stepLine`, `stepLinebr`, `stepArea`, `stepAreabr`, `bar`, `histogram`, `scatter`, `triangular` and `cross`.

Name a member with the set in front of it, as in `plotStyle.histogram`. The `br` endings are separate members, distinct from the plain forms.

**Fields**

| Name | Type | Description |
| - | - | - |
| `line` | | A named constant for the 'Line' style, to be used as an argument for the style parameter in the plot function. |
| `linebr` | | A named constant for the 'Line With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to `plotStyle.line`, except the gaps in the data are not filled. |
| `area` | | A named constant for the 'Area' style, to be used as an argument for the style parameter in the plot function. |
| `areabr` | | A named constant for the 'Area With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to `plotStyle.area`, except the gaps in the data are not filled. |
| `smoothedArea` | | A name constant used to  used to create a smoothly filled area between the plotted values and the x-axis (zero level or another base value). It provides a gradient-like appearance instead of a sharp, rigid fill. |
| `stepLine` | | A named constant for the 'Step Line' style, to be used as an argument for the style parameter in the plot function. |
| `stepLinebr` | | A named constant for the 'Step line with Breaks' style, to be used as an argument for the style parameter in the plot function. |
| `stepArea` | | A name constant used to create a stepped area chart, where the filled area follows a step-like pattern instead of a smooth curve. |
| `stepAreabr` | | A name constant used to create a stepped background area fill. This style is similar to plotStyle.stepArea, but instead of filling the area with a standard overlay, it applies a background-style fill that integrates smoothly with the chart. |
| `bar` | | Vertical column bars |
| `histogram` | | A named constant for the 'Histogram' style, to be used as an argument for the style parameter in the plot function. |
| `scatter` | | A named constant used to plot individual data points as scattered dots on the chart, instead of a continuous line |
| `triangular` | | A named constant used to plot a triangular wave-like pattern instead of a standard line. |
| `cross` | | A named constant for the 'Cross' style, to be used as an argument for the style parameter in the plot function. |

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("plotStyle Example", overlay=false)
plot(close - open, title="Body", color=color.blue, style=plotStyle.histogram)
plot(talib.sma(close - open, 10), title="Average Body", color=color.orange, style=plotStyle.line)
```

## `polyline` (type)

**Definition**

A multi-point drawing built from an array of chartPoint values. Unlike line, a polyline takes many vertices (at most 1000) and has an optional curve and fill.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Polyline Type Example", overlay=true)
if barstate.islast {
    pts = array.new<chartPoint>(0)
    array.push(pts, chartPoint.from_index(bar_index[20], low[20]))
    array.push(pts, chartPoint.from_index(bar_index[10], high[10]))
    array.push(pts, chartPoint.from_index(bar_index, close))
    polyline.new(pts, line_color=color.orange, line_width=2)
}
```

## `scale` (type)

**Definition**

Price-scale placement for scripts declared with `indicator()` or `strategy()`.

Use the `scale` argument on those declarations. Default is `scale.none`.

**Fields**

| Name | Type | Description |
| - | - | - |
| `left` | | Attach the script to the left price scale. |
| `right` | | Attach the script to the right price scale. |
| `none` | | Use the default scale for the script (separate pane when `overlay` is false). |

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("scale Example", overlay=true, scale=scale.right)
plot(close)
```

## `shape` (type)

**Definition**

The twelve markers `plotshape` can draw: `xcross`, `cross`, `triangleup`, `triangledown`, `flag`, `circle`, `arrowup`, `arrowdown`, `labelup`, `labeldown`, `square` and `diamond`.

Written `shape.triangleup` and so on.

**Fields**

| Name | Type | Description |
| - | - | - |
| `xcross` | | Shape style for plotshape function. |
| `cross` | | Shape style for plotshape function. |
| `triangleup` | | Shape style for plotshape function. |
| `triangledown` | | Shape style for plotshape function. |
| `flag` | | Shape style for plotshape function. |
| `circle` | | Shape style for plotshape function. |
| `arrowup` | | Shape style for plotshape function. |
| `arrowdown` | | Shape style for plotshape function. |
| `labelup` | | Shape style for plotshape function. |
| `labeldown` | | Shape style for plotshape function. |
| `square` | | Shape style for plotshape function. |
| `diamond` | | Shape style for plotshape function. |

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Shape Example", overlay=true)
// Define bullish and bearish engulfing conditions
bullishEngulfing = close > open and close[1] < open[1] and close > close[1] and open < open[1]
bearishEngulfing = close < open and close[1] > open[1] and close < close[1] and open > open[1]
// Plot a triangle up for bullish engulfing
plotshape(series=bullishEngulfing, location=location.belowbar, shape=shape.triangleup, color=color.green, title="Bullish Engulfing")
// Plot a triangle down for bearish engulfing
plotshape(series=bearishEngulfing, location=location.abovebar, shape=shape.triangledown, color=color.red, title="Bearish Engulfing")
// Plot a cross at every bar where the close is equal to the open (Doji)
doji = close == open
plotshape(series=doji, location=location.abovebar, shape=shape.cross, color=color.blue, title="Doji")
```

## `size` (type)

**Definition**

Six sizes for a marker: `auto`, `tiny`, `small`, `normal`, `large` and `huge`.

Used by the `size` parameter of `plotshape` and `plotchar`. `auto` is a member like the rest, not the absence of a choice.

**Fields**

| Name | Type | Description |
| - | - | - |
| `auto` | | Allows automatic size adjustment based on the chart's zoom level and resolution. |
| `tiny` | | Smallest size |
| `small` | | Small size |
| `normal` | | Default (medium) size |
| `large` | | Large size |
| `huge` | | Largest size |

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("size Example", overlay=true)
plotshape(talib.crossover(close, talib.sma(close, 20)), title="Cross Up", location=location.belowbar, shape=shape.triangleup, color=color.green, size=size.small)
plotshape(talib.crossunder(close, talib.sma(close, 20)), title="Cross Down", location=location.abovebar, shape=shape.triangledown, color=color.red, size=size.large)
```

## `string` (type)

**Definition**

A piece of text, written between double quotes: `"length"`.

Titles, messages and instrument details are strings. The `str` namespace holds the functions that work on them. No fields.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("string Example", overlay=true)
string trend = close > talib.sma(close, 20) ? "Up" : "Down"
if barstate.islast {
    label.new(bar_index, high, text="Trend: " + trend)
}
```

## `table` (type)

**Definition**

A screen-anchored grid (not bar/price anchored). At most one live table is shown per position.\*; creating another table at the same position deletes the previous one. Cells are created with table.cell; merged cells store colspan/rowspan on the origin cell.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Table Type Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1, bgcolor=color.gray)
    table.cell(t, 0, 0, text=str.tostring(close))
}
```


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