Functions
plotchar()
The same marker as `plotshape`, with one character in place of a shape from the fixed set. It draws exactly one character. Pass a longer string and it is cut to the first character, with no warning and no error, so pass the character you want.
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, input display display, input string format) → 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. display input display Controls where the plot is shown (pane, price scale, status line, data window). Use display.* constants; combine with +. Default is display.all. format input string Return Type
void Example
//@lipi=2
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)