OPEN-SOURCE SCRIPT

Volume Bandar Detector

46
//version=5
indicator("Broker Net Volume + Akumulasi", overlay=false, max_lines_count=500)

// --- Input setting ---
threshold = input.float(0.5, "Ambang Akumulasi (dalam % dari volume)", step=0.1)
maLength = input.int(5, "Panjang MA Net Volume", minval=1)

// --- Data dasar ---
buyVolume = volume * close / close // sementara pakai total volume (TradingView tidak bisa akses data broker real)
sellVolume = volume - buyVolume // dummy, hanya untuk contoh

// --- Net Volume ---
netVolume = buyVolume - sellVolume

// --- MA Net Volume ---
netVolMA = ta.sma(netVolume, maLength)

// --- Warna Histogram ---
barColor = netVolume >= 0 ? color.new(color.green, 0) : color.new(color.red, 0)

// --- Highlight Akumulasi (bar kuning) ---
highlight = netVolume > (threshold * volume)

// --- Plot Histogram Net Volume ---
plot(netVolume, style=plot.style_columns, color=highlight ? color.yellow : barColor, title="Net Volume")

// --- Plot Garis MA Net Volume ---
plot(netVolMA, color=color.blue, title="MA Net Volume", linewidth=2)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.