chrysopoetics

Yang & Zheng Extension of Garman & Klass

First off, a huge thank you to the following people:

theheirophant: www.tradingview.com/u/theheirophant/
alexgrover: www.tradingview.com/u/alexgrover/
NGBaltic: www.tradingview.com/u/NGBaltic/

This is the Yang & Zhang extension of Garman & Klass. The equation was modified to include the logarithm of the open price divided by the preceding close price. As a result, this function uses the open, high, low and close prices to estimate volatility. This modification allows the volatility estimator to account for the opening jumps, but as the original function, it assumes that the underlying follows a Brownian motion with zero drift (the historical mean return should be equal to zero). This estimator tends to overestimate the volatility when the drift is different from zero, however, for a zero drift motion, this estimator has an efficiency of eight times the classic close-to-close estimator (standard deviation).

This script allows you to transform the volatility reading. The intention of this is to be able to compare volatility across different assets and timeframes. Having a relative reading of volatility also allows you to better gauge volatility within the context of current market conditions.

For the signal lie I chose a repulsion moving average to remove choppy crossovers of the estimator and the signal. This may have been a mistake, so in the near-future I might update so that the MA can be selected. Let me know if you have any opinions either way.

References
www.rdocumentation.o...-4/topics/volatility
www.quantshare.com/i...volatility-estimator

Want to Learn?

If you'd like the opportunity to learn Pine but you have difficulty finding resources to guide you, take a look at this rudimentary list: docs.google.com/document/d/10t3Z...

The list will be updated in the future as more people share the resources that have helped, or continue to help, them. Follow me on Twitter to keep up-to-date with the growing list of resources.

Suggestions or Questions?

Don't even kinda hesitate to forward them to me. My (metaphorical) door is always open.

Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?