PROTECTED SOURCE SCRIPT
AlgoRanger FlowState

//version=5
indicator("AlgoRanger FlowState", overlay=true)
// === INPUTS ===
atrPeriod = input.int(10, title="ATR Period")
factor = input.float(3.0, title="Multiplier")
// === ATR & BASIC BANDS ===
atr = ta.atr(atrPeriod)
hl2 = (high + low) / 2
upperBand = hl2 + factor * atr
lowerBand = hl2 - factor * atr
// === SUPER TREND LOGIC ===
var float supertrend = na
var bool isUpTrend = true
if na(supertrend)
supertrend := hl2
else
if close > supertrend
supertrend := math.max(lowerBand, supertrend)
isUpTrend := true
else
supertrend := math.min(upperBand, supertrend)
isUpTrend := false
// === TREND REVERSAL SIGNALS ===
buySignal = isUpTrend and not isUpTrend[1]
sellSignal = not isUpTrend and isUpTrend[1]
// === PLOT SUPER TREND ===
plot(supertrend, title="Supertrend", color=isUpTrend ? color.green : color.red, linewidth=2)
// === PLOT COLOR-CODED BARS ===
barcolor(isUpTrend ? color.new(color.green, 0) : color.new(color.red, 0))
indicator("AlgoRanger FlowState", overlay=true)
// === INPUTS ===
atrPeriod = input.int(10, title="ATR Period")
factor = input.float(3.0, title="Multiplier")
// === ATR & BASIC BANDS ===
atr = ta.atr(atrPeriod)
hl2 = (high + low) / 2
upperBand = hl2 + factor * atr
lowerBand = hl2 - factor * atr
// === SUPER TREND LOGIC ===
var float supertrend = na
var bool isUpTrend = true
if na(supertrend)
supertrend := hl2
else
if close > supertrend
supertrend := math.max(lowerBand, supertrend)
isUpTrend := true
else
supertrend := math.min(upperBand, supertrend)
isUpTrend := false
// === TREND REVERSAL SIGNALS ===
buySignal = isUpTrend and not isUpTrend[1]
sellSignal = not isUpTrend and isUpTrend[1]
// === PLOT SUPER TREND ===
plot(supertrend, title="Supertrend", color=isUpTrend ? color.green : color.red, linewidth=2)
// === PLOT COLOR-CODED BARS ===
barcolor(isUpTrend ? color.new(color.green, 0) : color.new(color.red, 0))
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.