Sidechair

plotarrow()

Browse the reference

Draws an up arrow where series is positive and a down arrow where it is negative, with length scaled by the value.

Try it in the editor

plotarrow draws a green arrow pointing up when series is above zero, and a red arrow pointing down when it is below zero. Where series is 0 or na, no arrow is drawn.

Arrow length grows with the size of the value, scaled against the largest value in view. The arrow sits at the high end of the bar for up arrows and the low end for down arrows.

Syntax

Pine Script
plotarrow(series: series int/float, title: const string (optional), colorup: series color (optional), colordown: series color (optional), offset: simple int (optional), minheight: input int (optional), maxheight: input int (optional), editable: input bool (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/floatrequiredSeries that decides direction and size. Positive points up, negative points down, 0 and na draw nothing.
titleconst string"Arrow"Name shown in the legend and Data Window.
colorupseries color#4CAF50Color of the arrow drawn on bars where the series is above zero.
colordownseries color#FF5252Color of the arrow drawn on bars where the series is below zero.
offsetsimple int0Shifts the arrows by this many bars; negative moves them into the past.
minheightinput int5Smallest arrow height in pixels.
maxheightinput int100Largest arrow height in pixels.
editableinput booltrueAccepted for compatibility and ignored.
show_lastinput intnaAccepted for compatibility and ignored.
displayinput plot_displaydisplay.allWhere the arrows 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

  • On Sidechair: arrow length runs from 5 to 95 pixels in proportion to the value against the largest one in view; minheight and maxheight are accepted and not applied.

Example

Pine ScriptArrows from the bar's net moveOpen in editor
//@version=6
indicator("Move arrows", overlay = true)
move = close - open
plotarrow(move, "Move", colorup = color.teal, colordown = color.maroon)

See also

Runs on Sidechair