Functions
plotarrow()
Draws an arrow on each bar, sized from a number you supply. It is the odd one out among the markers: `plotshape` and `plotchar` take a condition, this takes a value. It also has no location, no shape, no size and no text — where an arrow sits follows from the number.
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 The number the arrow is drawn from. Required. Not a condition. title const string The name of the drawing. Const-form. colorup series color The colour used in one direction. Series-form, so it may differ on every bar. colordown series color The colour used in the other direction. Series-form. offset input int Shifts the drawing along the chart. Input-form, so it is fixed for the run of the script. minheight input int Lower bound on the arrow's height. Input-form. maxheight input int Upper bound on the arrow's height. Input-form. force_overlay const bool Sets this drawing's overlay, separately from the script-wide setting. 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)