Thursday Close Bands
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © sateesh1496

//@version=5
indicator("Thursday Close Bands", overlay = true)
bandsize = input.float(3,title= "Band Size")
tc= ta.valuewhen(dayofweek(time('D')) == dayofweek.thursday, close, 0)
upperband = tc*(1+(bandsize/100))
lowerband = tc*(1-(bandsize/100))
plot(tc,style=plot.style_stepline,linewidth=2)
plot(upperband[1],title="Upper Band", color=color.red,style=plot.style_stepline,linewidth=2)
plot(lowerband[1],title= "Lower Band", color=color.green,style=plot.style_stepline,linewidth=2)
c = color.green
bgColor = dayofweek == dayofweek.thursday ? color.new(c, 90) : color.new(color.white, 80)
bgcolor(color=bgColor, transp=90)