jeudi 20 mai 2021

Please help, how can I add checkbox to enable/disable this Ichimoku cloud pine script?

I have tried to add checkbox to enable/disable my modified Ichimoku cloud but I can find the way. Please help.

Ichimoku = input(true, "Ichimoku")

conversionPeriods = 9

basePeriods = 26

laggingSpan2Periods = 52

displacement = 26

donchian(len) => avg(lowest(len), highest(len))

conversionLine = donchian(conversionPeriods)

baseLine = donchian(basePeriods)

leadLine1 = avg(conversionLine, baseLine)

leadLine2 = donchian(laggingSpan2Periods)

p1 = plot(leadLine1, offset = displacement - 1, color=na,
     title="Lead 1", display = display.none)

p2 = plot(leadLine2, offset = displacement - 1, color=na,
     title="Lead 2", display = display.none)

fill(p1, p2, color = leadLine1 > leadLine2 ? color.black : color.black, editable=true)



Aucun commentaire:

Enregistrer un commentaire