0
votes

candleplot = input(defval=false , title='Plot Candle')

plotcandle(0,var7, 0, var7, color=var7>xrf(var7,1)?#FFF700:#3FFF00 ,editable=false)

i am writing like this

if candleplot

plotcandle(0,var7, 0, var7, color=var7>xrf(var7,1)?#FFF700:#3FFF00 ,editable=false)

But its giving error cannot use plotcandle in local scope.

I want to plot the candel when someone tick the checkbox

1

1 Answers

1
votes

You can put a ternary conditional on the value of close

plotcandle(0,var7, 0, candleplot ? var7 : na, color=var7>xrf(var7,1)?#FFF700:#3FFF00 ,editable=false)