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
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
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
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
Example
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
display (type)
Definition
Controls where a plot or indicator output is visible in the UI (pane, price scale, status line, data window).
Fields
Example
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
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
Example
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
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
Example
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
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
line (type)
Definition
A line drawing between two chart points. Use line.new to create lines and line.set_* functions to change them.
Example
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
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
Example
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
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
Example
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
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
Example
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
Example
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
Example
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