indicator · own pane · open source
Yang-Zhang Volatility indicator
Yang-Zhang Volatility is a free open-source indicator by @deepwick. Yang-Zhang Volatility combines overnight close-to-open variance, open-to-close drift and… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Yang-Zhang Volatility does
Yang-Zhang Volatility combines overnight close-to-open variance, open-to-close drift and intraday high-low range into a single annualised estimator.
- Handles gaps cleanly — open moves don't get washed out like in HV.
- Slightly noisier than GK but the most realistic single number for crypto & 24/7 markets.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Yang-Zhang Volatility", overlay=false)
len = input.int(20, "Lookback", minval=2, maxval=252)
colorBg = input.color("color.purple", "Color Bg")
yzX = math.pow(math.log(close / close[1]), 2) + 0.5 * math.pow(math.log(high / low), 2)
yzSum = ta.cum(yzX) - ta.cum(yzX)[len]
yz = math.sqrt(252 / len * yzSum)
p_YZ = plot(yz, "YZ", color=colorBg, linewidth=2)
No comments yet.
Sign in to comment.