OPEN-SOURCE SCRIPT

Unusual Volume

30
//version=5
indicator("Unusual Volume", overlay=false)

// --- Inputs ---
len = input.int(20, "Average Volume Length", minval=1)
mult = input.float(2.0, "Unusual Volume Multiplier", step=0.1)

// --- Calculations ---
avgVol = ta.sma(volume, len)
ratio = volume / avgVol
isBigVol = ratio > mult

// --- Plots ---
plot(volume, "Volume", style=plot.style_columns,
color = isBigVol ? color.new(color.green, 0) : color.new(color.gray, 60))

plot(avgVol, "Average Volume", color=color.orange)

// Mark unusual volume bars
plotshape(isBigVol, title="Unusual Volume Marker",
location=location.bottom, style=shape.triangleup,
color=color.green, size=size.tiny, text="UV")

// Optional: show ratio in Data Window
var label ratioLabel = na

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。