Skip to main content

Function: plot()

plot<T>(name, value, color?): void

Plot a time-series value on the main (price) pane. A na (NaN) value is a gap: it is silently skipped, so you can plot(name, value) during warmup without guarding each call with !na(...).

The na call still reaches the host (both hosts drop NaN from the event stream, so the wire is unchanged): the host uses it to REGISTER the plot name, so a warmup-hungry plot whose probed values are all na still appears as a figure instead of the indicator silently rendering nothing.

color colours this bar's point only (Pine plot(x, color = cond ? a : b)), for example green and red volume columns. Leave it out to use the colour from declarePlot. (rgba(0, 0, 0, 0) is the "not set" value, so it cannot be used as a per-bar colour; use color.withTransp(c, 100) to hide a bar.)

Type Parameters​

T​

T

Parameters​

name​

string

value​

T

color?​

i32 = 0

Returns​

void