Back to Community
my first algo, TTM Squeeze Code and some questions followed

Hi, guys,

I use TTM Squeeze in tradingview before, so I wrote a similar one in case anyone needs this.
I have some following questions:

in author's origin code, I only implemented squeeze on and squeeze off , I wonder how can I
implement the code below? Many thanks

val = linreg(source - avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)),

bcolor = iff( val > 0,
iff( val > nz(val[1]), lime, green),
iff( val < nz(val[1]), red, maroon))
scolor = noSqz ? blue : sqzOn ? black : gray
plot(val, color=bcolor, style=histogram, linewidth=4)
plot(0, color=scolor, style=cross, linewidth=2)

Loading notebook preview...
Notebook previews are currently unavailable.