Colorful Channel
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © faytterro

//@version=5
indicator("Colorful Channel", overlay=true, timeframe = "", timeframe_gaps = true)
len=input.int(168,title="lenght")
tr=input.float(2, title="transp", minval=0.5, step=0.5)
ymom=100*(high-ta.lowest(low,len))/ta.lowest(low,len)
dmom=-100*(low-ta.highest(high,len))/ta.highest(high,len)
x=ta.lowest(low,len)
cl=plot((close/2+open/2), display = display.none)
p1=plot(x, color=color.gray, linewidth=1)
a=ta.highest(high,len)
fill(p1,cl,top_value=a ,bottom_value=x, top_color =color.rgb(255, 0, 0, 100-ymom*tr), bottom_color =color.rgb(255, 0, 0, 100), fillgaps = true)
a1=plot(a, color=color.gray, linewidth=1)
fill(a1,cl,top_value=x ,bottom_value=a, top_color =color.rgb(0,255,0,100-dmom*tr), bottom_color = color.rgb(0,255,0,100), fillgaps = true)

