Voici le script :
study(“Waddah Attar Explosion V2 [SHK]”, shorttitle=“WAE [SHK]”)
sensitivity = input(150, title=“Sensitivity”)
fastLength=input(20, title=“FastEMA Length”)
slowLength=input(40, title=“SlowEMA Length”)
channelLength=input(20, title=“BB Channel Length”)
mult=input(2.0, title=“BB Stdev Multiplier”)
DEAD_ZONE = nz(rma(tr(true),100)) * 3.7
calc_macd(source, fastLength, slowLength) =>
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
fastMA – slowMA
calc_BBUpper(source, length, mult) =>
basis = sma(source, length)
dev = mult * stdev(source, length)
basis + dev
calc_BBLower(source, length, mult) =>
basis = sma(source, length)
dev = mult * stdev(source, length)
basis – dev
t1 = (calc_macd(close, fastLength, slowLength) – calc_macd(close[1], fastLength, slowLength))*sensitivity
e1 = (calc_BBUpper(close, channelLength, mult) – calc_BBLower(close, channelLength, mult))
trendUp = (t1 >= 0) ? t1 : 0
trendDown = (t1 < 0) ? (-1*t1) : 0
plot(trendUp, style=columns, linewidth=1, color=(trendUp<trendUp[1])?lime:green, transp=45, title=“UpTrend”)
plot(trendDown, style=columns, linewidth=1, color=(trendDown<trendDown[1])?orange:red, transp=45, title=“DownTrend”)
plot(e1, style=line, linewidth=2, color=#A0522D, title=“ExplosionLine”)
plot(DEAD_ZONE, color=blue, linewidth=1, style=cross, title=“DeadZoneLine”)