OPEN-SOURCE SCRIPT

VWAP Bands Naya

//version=5
indicator("VWAP Bands", overlay=true)

// Inputs
deviation = input.float(1.0, "Deviation %", step=0.1) / 100

// VWAP Calculation
vwap = ta.vwap(close)


// Calculate Bands
upperBand = vwap * (1 + deviation)
lowerBand = vwap * (1 - deviation)

// Plot VWAP and Bands
plot(vwap, color=color.blue, linewidth=2, title="VWAP")
plot(upperBand, color=color.green, linewidth=1, title="Upper Band")
plot(lowerBand, color=color.red, linewidth=1, title="Lower Band")

// Background Color for Trend
bgcolor(close > vwap ? color.new(color.green, 90) : color.new(color.red, 90))

כתב ויתור