PineScript plot shape or arrow on indicator panel

Is it possible to plot a shape or arrow on an indicator panel where Study(overlay=false)?

If I have a study declared like this

//@version=4
study("My Custom Indicator", overlay=false)
// ... 
plotarrow(true, title="EMA Cross", colorup=color.lime, colordown=color.red, transp=50)

It results in this

enter image description here

What I want to do is have the arrows at a specific Y-value where the indicator is drawing, but its using the main price chart price for its Y-value

Upvotes: 0

Views: 4236

Answers (1)

I have a solution for this using the plotShape function

shouldPlot = true // this is your series of booleans where you want to plot the shape
plotshape(yValue, style=shape.circle, color = shouldPlot ? color.green : na, location=location.absolute, size=size.tiny)

This plots a single dot (circle) at the yValue when shouldPlot is true

Upvotes: 1

Related Questions