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| Parameter | Type | Description |
|---|---|---|
series | float | The value to draw on each bar. |
title | const stringdefault "" | The name shown in the settings, legend and data window. |
color | colordefault na | The colour. |
linewidth | input intdefault 1 | Line width in pixels. |
style | input plot_styledefault plot.style_line | The style constant. |
trackprice | const booldefault false | Show a horizontal line at the last value. |
histbase | const floatdefault 0 | The base level of histogram, column, area, baseline and lollipop styles. |
offset | input intdefault 0 | Shift the output this many bars to the right (negative: left). |
join | const booldefault false | Accepted and ignored. |
editable | const booldefault true | Accepted and ignored (styles are always editable). |
show_last | const intdefault na | Accepted and ignored in this version. |
display | input displaydefault display.all | Where the value is shown (display.*). |
format | const formatdefault na | The number format (format.*). |
precision | const intdefault na | Decimals shown. |
force_overlay | const booldefault false | Accepted and ignored in this version. |
base | floatdefault na | The base. |
color_below | colordefault na | plot.style_baseline: the colour below histbase (the colour above is color). Default: color.down. |
autoscale | const booldefault true | false: drawn, but left out of the price scale's Auto range, so a value far from the price never squeezes the candles. |
role | const 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. |
linestyle | input stringdefault plot.linestyle_solid | The line style: plot.linestyle_solid, _dashed, _dotted, a dash.* constant or input.linestyle. |
look | const stringdefault "" | A style made with style.plot / style.line / style.marker / style.fill (its look, shared and user-editable). |
variant | const stringdefault "" | The name of one of the style's variants (style.variant). |
Returns plot.
Example
plot(ta.sma(close, 20), "SMA", color.accent, 2)Since ChartScript 1
#Constants
| Name | Type | Description |
|---|---|---|
plot.linestyle_dashed | string | Plot line style: dashed. |
plot.linestyle_dotted | string | Plot line style: dotted. |
plot.linestyle_solid | string | Plot line style: solid. |
plot.style_area | plot_style | Plot style: area. |
plot.style_areabr | plot_style | Plot style: areabr. |
plot.style_baseline | plot_style | Plot style: an area around the base level (histbase) in two colours: color above it, color_below below it. |
plot.style_circles | plot_style | Plot style: circles. |
plot.style_columns | plot_style | Plot style: columns. |
plot.style_cross | plot_style | Plot style: cross. |
plot.style_histogram | plot_style | Plot style: histogram. |
plot.style_line | plot_style | Plot style: line. |
plot.style_linebr | plot_style | Plot style: linebr. |
plot.style_lollipop | plot_style | Plot style: a thin stem from the base level (histbase) to the value, with a dot at the value. |
plot.style_markers | plot_style | Plot style: a line with a dot on every value. |
plot.style_range | plot_style | Plot style: a floating bar between the value and base on each bar (for example a high and a low). |
plot.style_smooth | plot_style | Plot 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_smoothbr | plot_style | Plot style: a smooth curve that breaks where a bar has no value. |
plot.style_stepline | plot_style | Plot style: stepline. |
plot.style_stepline_diamond | plot_style | Plot style: stepline diamond. |
plot.style_steplinebr | plot_style | Plot style: steplinebr. |