WHAT IS THIS?
This is my personal port of the Logarithmic Garman-Klass as openly found at iVolatility.com.
This estimator tends to be as fast as the RiskMetrics EWMA but without the noisy overshooting and will not lag as other estimators based on pure arithmetic Standard Deviation like Close-To-Close HV, Original Garman-Klass, Parkinson’s, Rogers-Satchell’s, Yang-Zhang, etc.
Cheers, and any contributions will be welcome.
// LOGARITHM GARMAN-KLASS VOLATILITY ESTIMATOR by @Xel_arjona
// Ported to ProReaCode as Formulae openly described in http://www.ivolatility.com/help/7.html
lnCC = log(close/close)
lnCO = log(close/open)
lnOC = log(open/close)
lnHL = log(high/low)
// Lambda definition:
lambda = Lookback/(Lookback+3)
//Initialization with Close-To-Close Historical Volatility
varCC = summation[Lookback](square(lnCC)) / Lookback
//Logarithmic Garman-Klass Realized/Historical Estimate as in iVolatility.com
v2 = square(lnoc) + 0.5*square(lnHL) - 0.386*square(lnCO)
varLGK = varCC
varLGK = exp( (1-lambda)*log(v2)+lambda*log(varLGK) )
LGKest = sqrt(varLGK)*sqrt(Compound) * 100
// PLOT DIRECTIVE
RETURN LGKest as "LGK"
DISCLAIMER: The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets.
The embedded code and ideas within this work are FREELY AND PUBLICLY available on the Web for NON LUCRATIVE ACTIVITIES and must remain as is by Creative-Commons and in regard of ProRealCode regulations. Any use, copy or re-use of this code should mention it’s origin as it’s authorship.
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :