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.

Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?