Functions
plotarrow()
Plots up and down arrows on the chart based on the indicator's values. An up arrow appears at every positive value, while a down arrow is drawn at every negative value. No arrow is displayed if the indicator returns na. The arrow length varies based on the absolute value of the indicator—the greater the value, the longer the arrow.
Syntax
plotarrow(series float series, const string title, series color colorup, series color colordown, input int offset, input int minheight, input int maxheight, const bool force_overlay) → void
Arguments
series required series float Series of data to be plotted as arrows. Required argument. title const string Title of the plot. colorup series color Color of the up arrows. Optional argument. colordown series color Color of the down arrows. Optional argument. offset input int Shifts arrows to the left or to the right on the given number of bars. Default is 0. minheight input int Maximum possible arrow height in pixels. Default is 100. maxheight input int Minimal possible arrow height in pixels. Default is 5. 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("Plot Arrow Example", overlay=true)
longCondition = talib.crossover(talib.sma(close, 10), talib.sma(close, 20))
shortCondition = talib.crossunder(talib.sma(close, 10), talib.sma(close, 20))
plotarrow(longCondition ? 1 : shortCondition ? -1 : na, title="Arrow Signals", colorup=color.lime, colordown=color.red,offset=-1)