na there: a line or an area breaks (a gap), and a plot that says join: true is drawn straight across the bars it has no value on. Histograms and points draw nothing on such a bar.
plot
(title: string, options?: LinePlotOptions): Plot
(title: string, options?: HistogramPlotOptions): Plot
(title: string, options?: AreaPlotOptions): Plot
(title: string, options?: PointsPlotOptions): Plot
Dots or crosses at each value, with no line between them unless they are joined.
(title: string, options: ShapeOptions): ShapePlot
A shape, a label or a character on the bars where
set says so.(title: string, options?: { pane?: PaneName }): MarkersPlot
(title: string, options?: ArrowsOptions): Plot
Arrows sized by their value, as Pine’s
plotarrow: up below the bar for a value above 0, down
above it for one below, none for 0 or na. An arrow’s height runs from minHeight to
maxHeight by its value’s size against the largest on the bars in view. set’s colour
replaces up or down on that bar.(title: string, a: Plot | LevelPlot, b: Plot | LevelPlot, options?: { color?: Color | null; /** * A gradient in place of the fill's one colour, from the highest edge of each stretch of the * fill to its lowest (`{ top, bottom }`), or from its left to its right. A colour set on a bar * with the fill's `set` still paints that bar. */ gradient?: Gradient; showLast?: number; hidden?: boolean; }): FillPlot
Shade between two plots or levels of this script, optionally per bar. Between two levels it
is a band across the whole pane. A fill takes the offset of its first plot, colours included.
(title: string, options?: { pane?: PaneName; offset?: number; showLast?: number; hidden?: boolean }): ColorPlot
Shade the whole height of the pane behind a bar.
(title: string, price: number, options?: { color?: Color | null; style?: LineStyle; width?: LineWidth; pane?: PaneName; hidden?: boolean }): LevelPlot
A horizontal line across the pane, such as 70 on an RSI. Returns a handle a fill can use.
(title: string, options?: CandlePlotOptions): CandlePlot
(title: string, options?: { offset?: number; showLast?: number; hidden?: boolean }): ColorPlot
Recolour the chart’s own candles, bodies, borders and wicks, as Pine’s
barcolor does.
null leaves a bar in the chart’s colours. Chart types without candles (footprints) say in
the legend that it does not apply there.(title: string, options?: CellsOptions): CellsPlot
Cells inside each bar, such as a footprint (bid × ask per price row) or a bar’s own volume
profile: rows of price bands with widths, colours and numbers, set from the chart’s handlers
with
add. Cells never stretch the price scale.(title: string, options: FootprintOptions): FootprintPlot
A footprint of the script’s own: amounts by price in up to 4 named lanes, drawn by the
footprint chart type as a Data choice beside Bid × Ask, with its rows, shapes, colours and
statistics rows. One per script. On a candle chart nothing is drawn, and the legend offers to
switch to the footprint.
(title: string, options?: HeatOptions | HeatSidesOptions): HeatPlot
A heat of the script’s own: amounts by time and price, drawn behind the candles by the order
book heatmap’s painter, one column a bar, rows grouped with the zoom and toned on the view’s
own scale. One or two sides; the chart carries values into later bars (
carry). One per script.PlotOptions
Color | null
PaneName
Hide from the chart, and from the legend’s values. With
legend: false too, a reading kept
for list columns (the watchlist, In play): never drawn, and a column starts on it.number
boolean
Show the last value as a tag on the price axis, without the line across the chart that
trackPrice adds. Default: false on the price pane, true in the script’s own pane.{ top: number; bottom: number }
The scale margins of the scale this plot sits on, as fractions of the pane, such as
{ top: 0.2, bottom: 0.28 }.{ top: number; bottom: number }
Draw on a hidden scale of its own inside the pane, between these fractions from the top and
the bottom, such as volume at the foot of the price pane:
{ top: 0.84, bottom: 0 }.{ min: number; max: number }
A fixed scale from
min to max instead of autoscaling, such as { min: 0, max: 100 }.boolean
false: the plot is drawn at its values but does not stretch its scale, which fits the rest
of the pane (the candles, on the price pane). For levels far from price, such as liquidation
clusters, that would otherwise squash the candles into a line; parts outside the view are
simply not seen. Default true.string | false
A short name the legend writes before this plot’s value, such as
'Sell', at most 24
characters. Without one the value stands alone, as the built-in studies’ values do. Narrow
charts leave the names out and keep the values. false draws the plot with no value in the
legend, for a column whose value other plots name.string
A unit the legend writes after this plot’s value, such as
'/s' or '×', at most 8 characters.number
Draw only the newest this many bars, a whole number from 1, as Pine’s
show_last. Default: every bar.number
Draw the plot shifted by this many bars, a whole number from -500 to 500. The value set on
bar
i is drawn on bar i + offset: a positive offset shifts the plot right, and its last
values are drawn past the newest bar, in the empty space to its right (Ichimoku’s leading
spans); a negative one shifts it left (the lagging span). The legend reads the value drawn
at the bar under the crosshair. Default 0.JoinOptions
boolean
Draw the line (and the area’s fill) across bars where the plot is
na, from the last value
to the next. Default false: the plot breaks there, as Pine’s plot.style_linebr and
style_areabr do. Pine’s style_line, style_stepline and style_area join, and the
translation of a pasted Pine script says so.Gradient
A gradient in place of a colour (#896):{ top, bottom } runs down the shape it fills, \{ left, right \} across it. Leave one end out to fade the other end’s colour to nothing.
Fill
A colour, or a gradient between two.LinePlotOptions
LineWidth
LineStyle
boolean | number
A soft glow in the line’s own colour, drawn under it:
true for 8px of blur, or 1 to 24px.
It follows the line’s colours bar by bar and breaks where the line does.boolean
Show the last value as a line across the chart and a tag on the price axis.
boolean | 'diamonds'
A staircase: flat from each value to the next bar’s, then straight up or down, as Pine’s
plot.style_stepline. 'diamonds' also marks each change of value with a diamond.HistogramPlotOptions
number
The value the bars grow from. Default 0.
LineWidth
Bars this many pixels wide, as Pine’s
plot.style_histogram. Leave it out for columns as
wide as the bar, as plot.style_columns.AreaPlotOptions
LineWidth
LineStyle
number
Fill from the line to this value, as Pine’s area fills to its
histbase. Leave it out for a
wash that fades to the foot of the pane.PointsPlotOptions
'circle' | 'cross'
LineWidth
The dots’ size: 1 is the smallest.
boolean
Join the points with a line, as Pine’s
join = true.CandlePlotOptions
boolean
OHLC bars, a tick left for the open and right for the close, as Pine’s
plotbar. Default: candles.Color | null
The wicks’ colour, and the bodies’ outline;
null draws none. Default: the body’s colour.Color | null
ArrowsOptions
Color | null
The colours of arrows up (values above 0) and down. Default
color.up and color.down.Color | null
number
The shortest and tallest arrow in pixels, 1 to 200. Default 5 and 100.
number
PaneName
number
Shift the arrows this many bars, as
PlotOptions.offset.number
Plot
(value: number, color?: Color | null): void
The value for the current bar, optionally with this bar’s colour.
LevelPlot
A horizontal line across the whole pane (plot.level). It can be one side of a plot.fill.
set moves it: the line is drawn at the price in effect on the newest bar, across every bar.
(price: number): void
ShapePlot
(condition: boolean, options?: { price?: number; text?: string; color?: Color | null; textColor?: Color | null }): void
Draw the shape on the current bar when
condition is true. price is used with
location: 'absolute'; text and color replace the plot’s own for this bar.ShapeOptions
ShapeName
The shape to draw. Give
char instead to draw a character (Pine’s plotchar).string
One character drawn in place of a shape, such as
'▲' or '•'.ShapeLocation
Color | null
Size
string
Written beside the shape, or inside a
labelUp / labelDown label.Color | null
The text’s colour. Default: the shape’s colour; inside a label, black or white, whichever reads on it.
PaneName
Kept in the declaration but not drawn, like a plot’s
hidden.number
Shift the shapes this many bars, as
PlotOptions.offset.number
Draw only the newest this many bars, as
PlotOptions.showLast.Marker
'above' | 'below' | 'at'
ShapeName
number
string
Color | null
MarkersPlot
(marker: Marker): void
Add a marker to the current bar. Several per bar are allowed.
ColorPlot
(color: Color | null): void
The colour for the current bar;
null for none.FillPlot
(top: number, bottom: number, topColor: Color | null, bottomColor: Color | null): void
Shade this bar with a gradient of its own, as Pine’s gradient
fill: topColor at the price
top and bottomColor at bottom, each colour held past its price. null fades that end
to nothing.CandlePlot
(bar: { open: number; high: number; low: number; close: number }, color?: Color | null, colors?: { wick?: Color | null; border?: Color | null }): void
colors gives this bar’s wick and border colours; null draws none, and leaving one out keeps the plot’s own.CellAlign
The edge a cell’s width grows from, which its number lines up with too.BarCell
One cell of a cells plot: a price band inside a bar, with a width, colours and a number.number
The band’s prices, in either order. A cell whose two prices are equal is not drawn.
number
number
How wide the cell is, as the plot’s
scale says; leave it out to fill the column. Zero or
less draws no fill, only the border and the number.number
The number written in the cell, in the plot’s format, when it fits; leave it out for none.
Color | null
The fill, border and number colours; leave one out for the plot’s own,
null for none.Color | null
Color | null
number
Which column, from 0 to
columns - 1. Default 0.CellAlign
'left' (the default) grows the cell from the column’s left edge, 'right' from its right edge, 'center' both ways.CellsPlot
(cell: BarCell): void
Add a cell to the current bar. Each run of a bar starts with none, so add every cell the bar
should show; a bar holds at most 1,024 cells, and a plot 250,000 over every bar (the oldest
bars lose theirs first).
FootprintLane
One lane of a footprint: what it holds, where it sits and its colour.string
The name
add, opposed and stats use: letters, digits and _, starting with a letter.string
What the legend, the row readout and the statistics row call it, such as
'New longs'.string
A shorter name for its statistics row.
'left' | 'right'
Left or right of the bar’s candle, at most 2 lanes a side. On each side the first lane
declared sits nearest the candle.
Color
Its colour, shaded by size. Default
color.down on the left and color.up on the right.'size' | 'count'
'size' (the default): amounts in the market’s base unit, printed in the chart’s USD or coin
unit as Bid × Ask is. 'count': amounts printed as they are, such as a number of orders.FootprintOptions
FootprintLane[]
1 to 4 lanes.
{ a: string; b: string; compare?: 'row' | 'diagonal' }[]
Up to 2 pairs of a left lane (
a) and a right lane (b) whose imbalances are marked, as Bid
× Ask marks buying against selling. compare: 'row' (the default) weighs the two at the same
price; 'diagonal' weighs b at a price against a one row below, which fits only taker
selling against taker buying. Leave it out and the footprint marks no imbalances.(string | { net: [string, string]; label?: string })[]
The statistics rows offered first under the bars, up to 8: a lane’s id is that lane summed
over the bar, and
{ net: [a, b], label } is lane a less lane b. Default: every lane.FootprintPlot
(lane: string, price: number, amount: number): void
Add
amount to lane at price on the trade’s bar. Call it from an event handler, such as
trades().onTrade: a forming bar’s onBar runs again, so it would count trades twice.
Prices snap to the market’s step and amounts at one price add up. 0 and na are left
out; an amount below 0 is an error, so split a signed value into two lanes.HeatSide
One of a heat’s two sides: what it holds and its colour.string
The name
add uses: letters, digits and _, starting with a letter.string
What the legend and the readout call it, such as
'Longs stopped'.Color
Its colour, shaded by amount. Default
color.down for the first side and color.up for the second.HeatCarry
How the chart carries a heat’s values into later bars, since a bar’s own trades sit under its candle.{ fade: n } halves a value every n bars (1 to 200); 'hold' keeps it at full
strength until a later bar’s range covers its price; 'none' draws each bar’s own values only.
HeatCommonOptions
'size' | 'count'
'size' (the default): amounts in the market’s base unit, read out in USD and coin.
'count': amounts read out as they are, such as a number of prints.HeatCarry
The carry the heat starts with,
{ fade: 10 } by default. The trader can change it in the heat’s settings, without a rerun.HeatOptions
string
What the legend and readout call the amounts, such as
'Prints'. Default: the title.Color
A ramp of this hue. Leave it out for the theme’s heat ramp, the order book heatmap’s blue to gold.
HeatSidesOptions
[HeatSide, HeatSide]
Exactly 2 sides. The first is the negative one: with
combine: 'net' it is subtracted.'net' | 'larger'
How a row’s two sides meet.
'net' (the default): they cancel, so a balanced row is quiet and
the rest shows in the larger side’s colour. 'larger': the row’s total, in its larger side’s colour.HeatPlot
(price: number, amount: number): void
Add
amount at price on the event’s bar; with two sides, add(side, price, amount). Call
it from an event handler, such as trades().onTrade: a forming bar’s onBar runs again, so
it would count trades twice. Prices snap to the market’s step and amounts at one price add
up. 0 and na are left out; an amount below 0 is an error, so give a signed value two sides.(side: string, price: number, amount: number): void
CellsOptions
1 | 2 | 3 | 4
Side-by-side columns in each bar, 1 to 4: two for bid × ask. Default 1.
'bar' | 'visible' | 'unit'
What a full-width cell means:
'bar' (the default) the largest weight on its own bar,
'visible' the largest on the bars in view, 'unit' a weight of 1 (weights are 0 to 1).'overlay' | 'side' | 'hidden'
The chart’s own candles while the cells show:
'overlay' (the default) leaves them behind
the cells, 'side' draws each as a thin strip at the left of its bar, 'hidden' draws none.
Only on the price pane of a chart that draws candles.'compact' | 'fixed' | 'percent'
How numbers are written:
'compact' (the default) shortens them, 3.21K; 'fixed' writes them
in full, 3214.56; 'percent' reads them as a fraction, 0.153 as 15.3%. A cell too small for
its number drops decimals, then shortens it, then shows none.number
Digits after the point, 0 to 8; leave it out to let the chart choose.
boolean
Write a + before numbers above 0.
boolean
Separate thousands with commas, with
'fixed' and 'percent'.Color | null
The default fill, border and number colours. Without a fill a cell is the theme’s study colour.
Color | null
Color | null
PaneName
The price pane, by default: cells are bands of price.