Functions
plotchar()
Plots visual shapes using any given one Unicode character on the chart.
Syntax
plotchar(series bool series, const string title, const string char, input location location, series color color, input int offset, const string text, series color textcolor, input size size, const bool force_overlay) → void
Arguments
series required series bool Series of data to be plotted as shapes. Series is treated as a series of boolean values for all location values except location.absolute. Required argument. title const string Title of the plot. char const string Character to use as a visual shape. location input location Location of shapes on the chart. Possible values are: location.abovebar, location.belowbar, location.top, location.bottom, location.absolute. Default value is location.abovebar. color series color Color of the candles. 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. offset input int Shifts shapes to the left or to the right on the given number of bars. Default is 0. text const string Text to display with the shape. You can use multiline text, to separate lines use '
' escape sequence. Example: 'line one
line two' textcolor series color Color of the candles. 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. size input size Size of characters on the chart. Possible values are: size.auto, size.tiny, size.small, size.normal, size.large, size.huge. Default is size.auto. 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
void Example
indicator("PlotChar Example", overlay=true)
conditionUp = close > close[1]
conditionDown = close < close[1]
plotchar(conditionUp, char='▲', location=location.abovebar, size=size.small, color=color.green)
plotchar(conditionDown, char='▼', location=location.belowbar, size=size.small, color=color.red)