Sidechair

plotchar()

Browse the reference

Marks bars with a single character, drawn where a condition is true or at an absolute price.

Try it in the editor

plotchar works like plotshape but draws one Unicode character instead of a preset shape. Pick a character such as "x", "▲" or "●". Only the first character of char is used.

The character, location, size and title are read on the first bar; the color and text color can change per bar. Optional text prints beside the character.

Syntax

Pine Script
plotchar(series: series int/float/bool, title: const string (optional), char: input string (optional), location: input string (optional), color: series color (optional), offset: simple int (optional), text: const string (optional), textcolor: series color (optional), editable: input bool (optional), size: const string (optional), show_last: input int (optional), display: input plot_display (optional), format: input string (optional), precision: input int (optional), force_overlay: const bool (optional)) -> void

Arguments

NameTypeDefaultDescription
seriesseries int/float/boolrequiredA bool or number. Where it is true or non-zero the character is drawn. With location.absolute it is the price level.
titleconst string"Char"Name shown in the legend and Data Window.
charinput string"★"The character to draw. Only its first character is used.
locationinput stringlocation.abovebarPlacement, a location.* constant: abovebar, belowbar, top, bottom or absolute.
colorseries color#2962FFCharacter color, evaluated per bar.
offsetsimple int0Shifts the characters by this many bars; negative moves them into the past.
textconst string""Text drawn with each character.
textcolorseries colornaColor of the text, evaluated per bar.
editableinput booltrueAccepted for compatibility and ignored.
sizeconst stringsize.autoSize, a size.* constant: auto, tiny, small, normal, large or huge.
show_lastinput intnaAccepted for compatibility and ignored.
displayinput plot_displaydisplay.allWhere the characters are shown. display.none hides them from the chart.
formatinput stringformat.inheritAccepted for compatibility and ignored.
precisioninput intnaAccepted for compatibility and ignored.
force_overlayconst boolfalseWhen true, draws on the main chart pane even if the script runs in its own pane.

Returns

Nothing.

Remarks

Example

Pine ScriptMark inside barsOpen in editor
//@version=6
indicator("Inside bars", overlay = true)
inside = high < high[1] and low > low[1]
plotchar(inside, "Inside bar", "•", location.abovebar, color.orange, size = size.small)

See also

Runs on Sidechair