mbarcala
Active member
I have this BB Squeeze that I would like to try in TOS. can some one help to convert this to thinkscript please?
if anyone know any link to any BB Squeeze that it can share with me I will appreciate?
if anyone know any link to any BB Squeeze that it can share with me I will appreciate?
Code:
study(title="Bollinger Bands Squeeze", shorttitle="BB Squeeze", overlay=false)
keltPrd=20
keltFactor=1.5
cciPeriod=50
BandsDeviations=2.0
BandsPeriod=20
d=cci(close,cciPeriod)
diff = atr(keltPrd)*keltFactor
std = stdev(close,BandsPeriod)
bbs = BandsDeviations * std / diff
res = bbs < 1 and d>0
res2 = bbs < 1 and d<=0
plot( (res or res2) ? 1 : na, style = histogram, color = black, linewidth =2)