In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
// // @author LazyBear // List of all my indicators: https://www.tradingview.com/v/4IneGo8h/ // study("Z distance from VWAP [LazyBear]", shorttitle="ZVWAP_LB") length=input(20) calc_zvwap(pds) => mean = sum(volume*close,pds)/sum(volume,pds) vwapsd = sqrt(sma(pow(close-mean, 2), pds) ) (close-mean)/vwapsd plot(0) upperTop=input(2.5) upperBottom=input(2.0) lowerTop=input(-2.5) lowerBottom=input(-2.0) plot(1, style=3, color=gray), plot(-1, style=3, color=gray) ul1=plot(upperTop, "OB High") ul2=plot(upperBottom, "OB Low") fill(ul1,ul2, color=red) ll1=plot(lowerTop, "OS High") ll2=plot(lowerBottom, "OS Low") fill(ll1,ll2, color=green) plot(calc_zvwap(length),title="ZVWAP",color=maroon, linewidth=2)
I have scanned around 3 years data manually, and it is doing great.
I wanted to tweak a little of your great code, to just be able to show the difference between the last and yesterday value of ZVWAP
so that I could tell the slope of the line from bar to bar.
since I am newbie in coding.
I tried to input --> plot calc_zvmap..... but it is not working.
and tried others but still no clue (tried also read the manual).
some hints or clue is very well appreciated.