PROTECTED SOURCE SCRIPT
AlgoRanger TrendFlow BB

//version=5
indicator("AlgoRanger TrendFlow BB", overlay=true)
// === Input ===
length = input.int(20, title="BB Length")
src = input(close, title="Source")
mult = input.float(2.0, title="StdDev Multiplier")
// === Bollinger Bands Calculation ===
basis = ta.sma(src, length)
dev = ta.stdev(src, length)
// === Additional Lines (6 Lines Total) ===
upper2 = basis + (2 * dev)
upper1 = basis + dev
lower1 = basis - dev
lower2 = basis - (2 * dev)
// === Trend Detection ===
isUptrend = close > basis
isDowntrend = close < basis
isSideway = not isUptrend and not isDowntrend
// === Color Based on Trend ===
upperBandColor = isUptrend ? color.rgb(106, 249, 111) : isDowntrend ? color.red : color.rgb(0, 140, 255)
lowerBandColor = isUptrend ? color.green : isDowntrend ? color.red : color.rgb(0, 140, 255)
basisColor = isUptrend ? color.green : isDowntrend ? color.red : color.rgb(0, 140, 255)
upper2Color = isUptrend ? color.green : color.rgb(0, 139, 253)
upper1Color = isUptrend ? color.green : color.rgb(0, 140, 255)
lower1Color = isDowntrend ? color.red : color.rgb(0, 140, 255)
lower2Color = isDowntrend ? color.red : color.rgb(0, 140, 255)
// === Plot Bollinger Bands with 6 Lines ===
plot(upper2, title="Upper 2", color=upper2Color, linewidth=1, style=plot.style_line)
plot(upper1, title="Upper 1", color=upper1Color, linewidth=1, style=plot.style_line)
plot(basis, title="Basis", color=basisColor, linewidth=3, style=plot.style_line)
plot(lower1, title="Lower 1", color=lower1Color, linewidth=1, style=plot.style_line)
plot(lower2, title="Lower 2", color=lower2Color, linewidth=1, style=plot.style_line)
indicator("AlgoRanger TrendFlow BB", overlay=true)
// === Input ===
length = input.int(20, title="BB Length")
src = input(close, title="Source")
mult = input.float(2.0, title="StdDev Multiplier")
// === Bollinger Bands Calculation ===
basis = ta.sma(src, length)
dev = ta.stdev(src, length)
// === Additional Lines (6 Lines Total) ===
upper2 = basis + (2 * dev)
upper1 = basis + dev
lower1 = basis - dev
lower2 = basis - (2 * dev)
// === Trend Detection ===
isUptrend = close > basis
isDowntrend = close < basis
isSideway = not isUptrend and not isDowntrend
// === Color Based on Trend ===
upperBandColor = isUptrend ? color.rgb(106, 249, 111) : isDowntrend ? color.red : color.rgb(0, 140, 255)
lowerBandColor = isUptrend ? color.green : isDowntrend ? color.red : color.rgb(0, 140, 255)
basisColor = isUptrend ? color.green : isDowntrend ? color.red : color.rgb(0, 140, 255)
upper2Color = isUptrend ? color.green : color.rgb(0, 139, 253)
upper1Color = isUptrend ? color.green : color.rgb(0, 140, 255)
lower1Color = isDowntrend ? color.red : color.rgb(0, 140, 255)
lower2Color = isDowntrend ? color.red : color.rgb(0, 140, 255)
// === Plot Bollinger Bands with 6 Lines ===
plot(upper2, title="Upper 2", color=upper2Color, linewidth=1, style=plot.style_line)
plot(upper1, title="Upper 1", color=upper1Color, linewidth=1, style=plot.style_line)
plot(basis, title="Basis", color=basisColor, linewidth=3, style=plot.style_line)
plot(lower1, title="Lower 1", color=lower1Color, linewidth=1, style=plot.style_line)
plot(lower2, title="Lower 2", color=lower2Color, linewidth=1, style=plot.style_line)
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
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.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
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.