Functions
plot()
Plots a series of data on the chart.
Syntax
plot(series float series, const string title, series color color, input int linewidth, input plotStyle style, input bool trackprice, input float histbase, input int offset, const bool force_overlay) → series plot
Arguments
series required series float Series of data to be plotted. Required argument. title const string Title of the plot. color series color Color of the plot. You can use constants like 'color=color.red' or 'color=#ff001a' as well as complex expressions like 'color = close >= open ? color.green : color.red'. Optional argument. linewidth input int Width of the plotted line. Default value is 1. Not applicable to every style. style input plotStyle Type of plot. Possible values are: plotStyle.line, plotStyle.stepLine, plotStyle.stepLinebr, plotStyle.stepArea, plotStyle.stepAreabr, plotStyle.histogram, plotStyle.area,plotStyle.areabr, plotStyle.bar, plotStyle.scatter, plotStyle.cross,plotStyle.smoothedArea,plotStyle.triangular. Default value is plotStyle.line. trackprice input bool If true then a horizontal price line will be shown at the level of the last indicator value. Default is false. histbase input float The price value used as the reference level when rendering plot with plot.style_histogram, plot.style_columns or plot.style_area style. Default is 0.0. offset input int Shifts the plot to the left or to the right on the given number of bars. Default is 0. force_overlay const bool If true, the plotted results will display on the main chart pane, even when the script occupies a separate pane. Optional. The default is false. Return Type
series plot Example
indicator("Conditional Plot", overlay=True)
signal = close > talib.sma(close, 14) ? close : na
plot(signal, color=color.green, title="Above SMA Signal", style=plotStyle.scatter)