OPEN-SOURCE SCRIPT

BTC vs USDT Dominance + Info

62
//version=5
indicator("BTC vs USDT Dominance + Info", overlay=false)

// Ambil data BTCUSDT (Bybit)
btc = request.security("BYBIT:BTCUSDT", timeframe.period, close)

// Ambil data USDT Dominance (USDT.D)
usdtDom = request.security("CRYPTOCAP:USDT.D", timeframe.period, close)

// Normalisasi biar skalanya sama
btcNorm = (btc - ta.lowest(btc, 200)) / (ta.highest(btc, 200) - ta.lowest(btc, 200)) * 100
usdtNorm = (usdtDom - ta.lowest(usdtDom, 200)) / (ta.highest(usdtDom, 200) - ta.lowest(usdtDom, 200)) * 100

// Plot garis
plot(btcNorm, color=color.green, title="BTC (Normalized)", linewidth=2)
plot(usdtNorm, color=color.red, title="USDT Dominance (Normalized)", linewidth=2)

// Deteksi arah candle terakhir
btcUp = ta.change(btc) > 0
btcDown = ta.change(btc) < 0

// Label info otomatis
if btcUp
label.new(bar_index, btcNorm, "BTC Naik → USDT Dominance Turun",
color=color.green, textcolor=color.white, style=label.style_label_up)

if btcDown
label.new(bar_index, btcNorm, "BTC Turun → USDT Dominance Naik",
color=color.red, textcolor=color.white, style=label.style_label_down)

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。