Skip to content
ChartDeck ChartScript docs Account Open the terminal

plot

Draws a series. The result can be used by fill().

#Functions

#plotfunction

Draws a series. The result can be used by fill().

plot(series: float, { title?: const string = "", color?: color = na, linewidth?: input int = 1, style?: input plot_style = plot.style_line, trackprice?: const bool = false, histbase?: const float = 0, offset?: input int = 0, join?: const bool = false, editable?: const bool = true, show_last?: const int = na, display?: input display = display.all, format?: const format = na, precision?: const int = na, force_overlay?: const bool = false, base?: float = na, color_below?: color = na, autoscale?: const bool = true, role?: const string = "", linestyle?: input string = plot.linestyle_solid, look?: const string = "", variant?: const string = "" }): plot
ParameterTypeDescription
seriesfloatThe value to draw on each bar.
titleconst stringdefault ""The name shown in the settings, legend and data window.
colorcolordefault naThe colour.
linewidthinput intdefault 1Line width in pixels.
styleinput plot_styledefault plot.style_lineThe style constant.
trackpriceconst booldefault falseShow a horizontal line at the last value.
histbaseconst floatdefault 0The base level of histogram, column, area, baseline and lollipop styles.
offsetinput intdefault 0Shift the output this many bars to the right (negative: left).
joinconst booldefault falseAccepted and ignored.
editableconst booldefault trueAccepted and ignored (styles are always editable).
show_lastconst intdefault naAccepted and ignored in this version.
displayinput displaydefault display.allWhere the value is shown (display.*).
formatconst formatdefault naThe number format (format.*).
precisionconst intdefault naDecimals shown.
force_overlayconst booldefault falseAccepted and ignored in this version.
basefloatdefault naThe base.
color_belowcolordefault naplot.style_baseline: the colour below histbase (the colour above is color). Default: color.down.
autoscaleconst booldefault truefalse: drawn, but left out of the price scale's Auto range, so a value far from the price never squeezes the candles.
roleconst stringdefault ""What the color of this output means, for the color presets of the Colors tab: "up", "down", "neutral" or "accent". Empty = guessed from the role of its style (look), the theme color, the title and the hue (a teal line counts as up). Another value is error CS2014.
linestyleinput stringdefault plot.linestyle_solidThe line style: plot.linestyle_solid, _dashed, _dotted, a dash.* constant or input.linestyle.
lookconst stringdefault ""A style made with style.plot / style.line / style.marker / style.fill (its look, shared and user-editable).
variantconst stringdefault ""The name of one of the style's variants (style.variant).

Returns plot.

Example

ChartScriptFragmentOpen in editor
plot(ta.sma(close, 20), "SMA", color.accent, 2)

Since ChartScript 1

#Constants

NameTypeDescription
plot.linestyle_dashedstringPlot line style: dashed.
plot.linestyle_dottedstringPlot line style: dotted.
plot.linestyle_solidstringPlot line style: solid.
plot.style_areaplot_stylePlot style: area.
plot.style_areabrplot_stylePlot style: areabr.
plot.style_baselineplot_stylePlot style: an area around the base level (histbase) in two colours: color above it, color_below below it.
plot.style_circlesplot_stylePlot style: circles.
plot.style_columnsplot_stylePlot style: columns.
plot.style_crossplot_stylePlot style: cross.
plot.style_histogramplot_stylePlot style: histogram.
plot.style_lineplot_stylePlot style: line.
plot.style_linebrplot_stylePlot style: linebr.
plot.style_lollipopplot_stylePlot style: a thin stem from the base level (histbase) to the value, with a dot at the value.
plot.style_markersplot_stylePlot style: a line with a dot on every value.
plot.style_rangeplot_stylePlot style: a floating bar between the value and base on each bar (for example a high and a low).
plot.style_smoothplot_stylePlot style: a smooth curve through the values. It never goes above or below the values it joins. Bars without a value are bridged.
plot.style_smoothbrplot_stylePlot style: a smooth curve that breaks where a bar has no value.
plot.style_steplineplot_stylePlot style: stepline.
plot.style_stepline_diamondplot_stylePlot style: stepline diamond.
plot.style_steplinebrplot_stylePlot style: steplinebr.

The ChartScript documentation is in English for now; translations will follow.