Skip to content

plotarrow() - Pine Script Function

plotarrow() converts a numeric series into vertical arrows: positive values draw upward arrows, negative values draw downward arrows, and na values produce no arrow. The absolute magnitude controls arrow height, so tall arrows immediately highlight stronger readings.

Declare your script with overlay=true when you want the arrows to appear on the main price pane.

plotarrow(series, title, colorup, colordown, offset, minheight, maxheight, editable, show_last, display, format, precision, force_overlay) → void
NameTypeDescription
seriesseries int/floatValues to convert into arrows. Positive numbers plot above the bar, negative numbers below.
titleconst string (optional)Name displayed in the legend and style dialog.
colorupseries color (optional)Color for upward arrows. Defaults to chart theme green.
colordownseries color (optional)Color for downward arrows. Defaults to chart theme red.
offsetsimple int (optional)Shift arrows forward/backward by N bars.
minheightinput int (optional)Minimum arrow size in pixels (default 5).
maxheightinput int (optional)Maximum arrow size in pixels (default 100).
displayinput plot_display (optional)Choose where to show arrow data (pane, status line, etc.).

Other arguments (editable, show_last, format, precision, force_overlay) mirror those in plot().

  • Arrows use the close price for their anchor by default. Apply an offset if you need them to point to earlier bars (e.g., offset=-1).
  • Scale the series yourself when you want consistent arrow heights regardless of magnitude, e.g., use series = longSignal ? 1 : shortSignal ? -1 : 0.
  • To hide arrows during certain bars, return na from the series expression.
//@version=5
indicator("plotarrow() signals", overlay=true)
fast = ta.ema(close, 21)
slow = ta.ema(close, 55)
longSignal = ta.crossover(fast, slow)
shortSignal = ta.crossunder(fast, slow)
arrowSeries = longSignal ? 1 : shortSignal ? -1 : 0
plotarrow(arrowSeries,
title="EMA cross signals",
colorup=color.new(color.green, 0),
colordown=color.new(color.red, 0),
minheight=10,
maxheight=50)