PROTECTED SOURCE SCRIPT

Sniper Pro v4.5 – Candle & Flow Intelligence Edition

19

//version=5
indicator("Sniper Pro v4.5 – Candle & Flow Intelligence Edition", overlay=true)

// === INPUTS ===
showDelta = input.bool(true, "Show OHLC + Delta Bubble")
showSM = input.bool(true, "Show Smart Money Bubble")
depth = input.int(12, "Golden Zone Depth")

// === INDICATORS ===
sma20 = ta.sma(close, 20)
vwapVal = ta.vwap

// === GOLDEN ZONE ===
ph = ta.pivothigh(high, depth, depth)
pl = ta.pivotlow(low, depth, depth)
var float lastHigh = na
var float lastLow = na
lastHigh := not na(ph) ? ph : lastHigh[1]
lastLow := not na(pl) ? pl : lastLow[1]
fullrange = lastHigh - lastLow
goldenTop = lastHigh - fullrange * 0.618
goldenBot = lastHigh - fullrange * 0.786
inGoldenZone = close >= goldenBot and close <= goldenTop

// === DELTA ===
delta = (close - open) * volume
absDelta = math.abs(delta)
deltaColor = delta > 0 ? color.new(color.green, 70) : color.new(color.red, 70)
deltaStr = absDelta > 1e6 ? str.tostring(delta / 1e6, "#.##") + "M" :absDelta > 1e3 ? str.tostring(delta / 1e3, "#.##") + "K" :str.tostring(delta, "#.##")

// === CANDLE COLORING ===
barcolor(absDelta > 2 * ta.sma(absDelta, 14) ? (delta > 0 ? color.green : color.red) : na)

// === OHLC + DELTA BUBBLE ===
if showDelta
var label infoLabel = na
infoText = "O: " + str.tostring(open, "#.##") +
"\nH: " + str.tostring(high, "#.##") +
"\nL: " + str.tostring(low, "#.##") +
"\nC: " + str.tostring(close, "#.##") +
"\nΔ: " + deltaStr
infoLabel := label.new(bar_index, high + syminfo.mintick * 20, infoText,style=label.style_label_up, size=size.small,textcolor=color.white, color=color.new(color.gray, 80))

// === SMART MONEY SIGNAL ===
efficiency = math.abs(close - open) / (high - low + 1e-10)
isExplosive = efficiency > 0.6 and absDelta > 2 * ta.sma(delta, 14)
smBuy = close > open and isExplosive and inGoldenZone and close > sma20
smSell = close < open and isExplosive and inGoldenZone and close < sma20

if showSM
if smBuy
var label smBuyLabel = na
smBuyLabel := label.new(bar_index, low - syminfo.mintick * 10, "SM Buy", style=label.style_label_up,size=size.normal, color=color.yellow, textcolor=color.black)
if smSell
var label smSellLabel = na
smSellLabel := label.new(bar_index, high + syminfo.mintick * 10, "SM Sell", style=label.style_label_down,size=size.normal, color=color.orange, textcolor=color.black)

// === SIDEWAYS ZONE WARNING ===
range20 = ta.highest(high, 20) - ta.lowest(low, 20)
atr = ta.atr(14)
isSideways = range20 < atr * 1.5
blinking = isSideways and bar_index % 2 == 0

plotshape(blinking, title="Sideways Warning", location=location.top,style=shape.triangleup, size=size.small,color=color.new(color.yellow, 0), text="⚠️")

// === PLOTS ===
plot(vwapVal, title="VWAP", color=color.aqua)
plot(goldenTop, title="Golden Top", color=color.yellow)
plot(goldenBot, title="Golden Bottom", color=color.orange)

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.