2
$\begingroup$

In "Volatility Trading" Euan Sinclair defines Yang-Zhang volatility estimator as

$$ \sigma = \sqrt{\sigma^2_o + k\sigma^2_c + (1-k)\sigma^2_{rs}} $$

where $$ \sigma^2_o \propto Variance\left(ln\left(\frac{o_i}{o_{i-1}}\right)\right) $$ $$ \sigma^2_c \propto Variance\left(ln\left(\frac{c_i}{c_{i-1}}\right)\right) $$ $$ \sigma^2_{rs} = \frac{1}{N} \sum_{i=1}^N \left( \left(ln \frac{h_i}{c_i}\right) \left(ln \frac{h_i}{o_i}\right) + \left(ln \frac{l_i}{c_i}\right) \left(ln \frac{l_i}{o_i}\right) \right) $$

/* I'm using $\propto$ symbol as "proportional to" to avoid unbiasing the $Variance$ via multiplying $Variance$ by $\frac{N}{N-1}$. See the actual formulas on the screenshot below in the References. */

However, TTR package 1 uses different formulas for $\sigma_o^2$, $\sigma_c^2$:

$$ \sigma^2_o \propto Variance\left(ln\left(\frac{o_i}{c_{i-1}}\right)\right) $$ $$ \sigma^2_c \propto Variance\left(ln\left(\frac{c_i}{o_{i}}\right)\right) $$

I plotted Garman-Klass, Parkinson, Yang-Zhang (TTR and Sinclair's) estimators on a chart:

chart with various volatility estimators

It shows how Sinclair's Yang-Zhang definition systematically deviates (and overestimates?) the volatility compared to the rest of the estimators.

Question

Does Sinclair's formula have a typo?

References

TTR Yang-Zhang volatility estimator

  • Yang-Zhang volatility estimator from Sinclair's book: screenshot yang-zhang volatility from Sinclair's book
$\endgroup$

1 Answer 1

4
$\begingroup$

When in doubt, consult the original paper:

In the beginning of the paper, the authors describe the following definitions for the normalized open and close (p. 479):

\begin{align*} o&=\ln(O_1) - \ln(C_0) = \ln\left(\frac{O_1}{C_0}\right), \quad \text{normalized open;}\\ c&=\ln(C_1) - \ln(O_1)= \ln\left(\frac{C_1}{O_1}\right), \quad \text{normalized close.} \end{align*}

Furthermore in Section II they define their volatility estimator as (pp. 482 - 488):

\begin{align*} V &= V_O + k \cdot V_C + (1-k) \cdot V_{RS}\\ V_O&= \frac{1}{n-1}\sum_{i=1}^n (o_i - \bar{o})^2\\ V_C&= \frac{1}{n-1}\sum_{i=1}^n (c_i - \bar{c})^2\\ \bar{o}&=\frac{1}{n}\sum_{i=1}^n o_i\\ \bar{c}&=\frac{1}{n}\sum_{i=1}^n c_i,\\ \end{align*} where $V_{RS}$ is derived later in the paper. Writing out one of the variance measures — using the notation from the original paper — gives you a clear indication that the TTR package has defined the Yang-Zhang estimator as originally intended: \begin{align*} V_O&= \frac{1}{n-1}\sum_{i=1}^n (o_i - \bar{o})^2\\ &=\frac{1}{n-1}\sum_{i=1}^n \left(o_i - \frac{1}{n}\sum_{i=1}^n o_i\right)^2\\ &=\frac{1}{n-1}\sum_{i=1}^n \left(\ln\left(\frac{O_i}{C_{i-1}}\right) - \frac{1}{n}\sum_{i=1}^n \ln\left(\frac{O_i}{C_{i-1}}\right)\right)^2\\ &=V_O^{\text{TTR}}. \end{align*} You can do the same derivation for $V_C$. Yes, I believe Sinclair has a few mistakes in his book.

$\endgroup$
1
  • 1
    $\begingroup$ The quality of questions and answers here is unmatched. Thank you Pleb! $\endgroup$ Commented Aug 2, 2022 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.