PROTECTED SOURCE SCRIPT

Volatility Squeeze

//version=5
indicator("Volatility Squeeze", overlay=true)

// Bollinger Bands
bbLength = input(20, "BB Length")
bbMult = 2.0
[bbUpper, bbBasis, bbLower] = ta.bb(close, bbLength, bbMult)

// Keltner Channels
kcLength = input(20, "KC Length")
kcMult = 1.5
trueRange = ta.tr
kcUpper = ta.ema(close, kcLength) + ta.ema(trueRange, kcLength) * kcMult
kcLower = ta.ema(close, kcLength) - ta.ema(trueRange, kcLength) * kcMult

// Squeeze Condition
squeeze = bbUpper < kcUpper and bbLower > kcLower

// Volume Surge
volumeAvg = ta.sma(volume, 20)
volumeSpike = volume > volumeAvg * 2

// Buy Signal: Squeeze Breakout + Volume Spike
buySignal = ta.crossover(close, bbUpper) and squeeze[1] and volumeSpike
plotshape(buySignal, style=shape.triangleup, color=color.green, location=location.belowbar)

Clause de non-responsabilité