VWAP angle Trend
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TZack88

//@version=5
indicator("VWAP angle",overlay = false)
string  CORE                            =  "➞ Main Core Settings 🔸"
float   scr                             = input.source(hlc3,"Source",group = CORE)
int     lookback                        = input.int(title='LookBack', defval=10,group = CORE)
int     ATR                             = input.int(title='ATR Period', defval=14,group = CORE)


  
Vwap_angle(_src, _lookback) =>
    math.todegrees(math.atan((_src[1] - _src[_lookback]) / ta.atr(ATR)))

ang = math.min(math.max(Vwap_angle(ta.vwap(scr), lookback), -100), 100)

Angplot = plot(ang,color = color.from_gradient(ang,-90,70,top_color = #70e1f5,bottom_color = #ffd194),linewidth = 2,title = "V-Angle")
lowBand = hline(-65,color=color.new(color.lime,85),title = "Low Band")
lowerband = hline(-80,color=color.new(color.lime,85),title = "Lower Band")

highband = hline(65,color=color.new(color.red,85),title = "High Band")
higherband = hline(80,color=color.new(color.red,85),title = "Higher Band")
lineplot = plot(65,display = display.none,editable = false)

fill(lowBand,lowerband,color= color.new(#1c4a10, 90))
fill(highband,higherband,color= color.new(#e3332d, 95))
fill(lowBand,highband,65,-65,top_color = color.new(#3F5EFB, 95), bottom_color = color.new(#FC466B, 95))
fill(Angplot, lineplot, -65, -90,  top_color = color.new(color.green, 100), bottom_color = color.new(#2ef835, 0),title = "Oversold Fill")
fill(Angplot, lineplot, 100, 65, top_color = color.new(#f52d2d, 5), bottom_color = color.new(#ff5252, 100),title = "Overbought Fill")

// bgcolor(con ? color.new(color.red,85): na )